[Flow] Delete Entity extends TYPO3 Abstractparty
Rémy DANIEL
dogawaf at no-log.org
Sun Oct 19 20:20:32 CEST 2014
Hi Rocky
I think you should remove the school with the schoolRepository, not with
the partyRepository.
And you should also remove the accounts of the school with
accountRepository.
Regards
--
Rémy
2014-10-19 10:49 GMT+02:00 Rocky <rockysynergy at gmail.com>:
> Hi,
>
> School extends \TYPO3\Party\Domain\Model\AbstractParty. I tried to code
> SchoolController's DeleteAction within below code:
>
> public function deleteAction(\Hwwcn\Sponsor\Domain\Model\School $school)
> { foreach
> ($school->getAccounts() as $account) {
> $school->removeAccount($account);
> } $this->partyRepository->remove($school);
> }
>
> But I got error saying: "SQLSTATE[23000]: Integrity constraint violation:
> 1451 Cannot delete or update a parent row: a foreign key constraint fails
> (`dev_flow3`.`typo3_flow_security_account`, CONSTRAINT
> `typo3_flow_security_account_ibfk_1` FOREIGN KEY (`party`) REFERENCES
> `typo3_party_domain_model_abstractparty` (`persistence_object_identi)"
>
> Any idea please?
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
More information about the Flow
mailing list