Created
August 8, 2012 14:54
-
-
Save gzankevich/3295625 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$em = $this->getEntityManager(); | |
$viewing = new Viewing(); | |
$viewing->setMeetingPerson('t'); | |
$viewing->setMeetingPlace('t'); | |
$viewing->setContactNumber('1'); | |
$viewing->setViewingAt(new \DateTime()); | |
$lmo = new LeadMatchingOffice(); | |
$lmo->addViewing($viewing); | |
$lmo->setDistanceMiles(1); | |
$viewing->setLeadMatchingOffice($lmo); | |
$em->persist($lmo); | |
$em->flush(); | |
$em->remove($lmo); | |
$em->flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Phoenix\CRMBundle\Entity\LeadMatchingOffice: | |
type: entity | |
table: lead_matching_office | |
id: | |
id: | |
type: integer | |
generator: { strategy: AUTO } | |
fields: | |
... | |
oneToMany: | |
viewings: | |
targetEntity: Phoenix\CRMBundle\Entity\Viewing | |
mappedBy: lead_matching_office | |
cascade: [persist, delete] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`phoenix`.`viewing`, CONSTRAINT `FK_F5BB46989B12193B` FOREIGN KEY (`lead_matching_office_id`) REFERENCES `lead_matching_office` (`id`)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Phoenix\CRMBundle\Entity\Viewing: | |
type: entity | |
table: viewing | |
id: | |
id: | |
type: integer | |
generator: { strategy: AUTO } | |
fields: | |
... | |
manyToOne: | |
lead_matching_office: | |
targetEntity: Phoenix\CRMBundle\Entity\LeadMatchingOffice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment