[FLOW3-general] Problem with Partypackage
Martin
titusmailing at googlemail.com
Thu Aug 9 13:55:50 CEST 2012
Hi Steffen,
I made a silly mistake, I didn't Inject the PartyRepository!
Thanks for your Reply!
Greetz
Martin
On 08/09/2012 01:20 PM, Steffen Wickham wrote:
> Hello Martin,
>
> I don't know if it solve your problem but try to persist $student before
> you call $student->addAccount($account). It seems to me that the
> addAccount method of AbstractParty tries to add the party-object to your
> account data, but you haven't saved the party record yet. So the
> database constraint fails and should throw this message.
>
> Cheers
> Steffen
>
>
>
> Am 09.08.12 12:57, schrieb Martin:
>> Dear List,
>>
>> I have massive problems implementing the partypackage.
>>
>> By now I extended the \TYPO3\Party\Domain\Model\Person(); set the name
>> with PersonName()
>>
>> this is all working until I try to add this Party to the account.
>>
>> $account = $this->accountFactory->createAccountWithPassword($name,
>> $pass, array($defaultRole));
>>
>> $this->accountRepository->add($account);
>>
>> $studentName = new \TYPO3\Party\Domain\Model\PersonName('', 'erster',
>> 'mitte','letzter');
>>
>> $student = new \TYPO3\Party\Domain\Model\Person();
>> $student->setName($studentName);
>> $student->addAccount($account);
>> $this->persistenceManager->persistAll();
>>
>> I will get this Error
>> 'A new entity was found through the relationship
>> 'TYPO3\FLOW3\Security\Account#party' that was not configured to
>> cascade persist operations for entity:
>> TYPO3\Party\Domain\Model\Person at 0000000037e9c9080000000061f869ce. To
>> solve this issue: Either explicitly call EntityManager#persist() on
>> this unknown entity or configure cascade persist this association in
>> the mapping for example @ManyToOne(..,cascade={"persist"}). If you
>> cannot find out which entity causes the problem implement
>> 'TYPO3\Party\Domain\Model\AbstractParty#__toString()' to get a clue.'
>>
>> But I don't get a clue how to fix that. Even I tried to add Person()
>> directly.
>>
>> Can anyone give me a hint to solve this problem?
>>
>> Cheers
>>
>> Martin
>>
>> _______________________________________________
>> FLOW3-general mailing list
>> FLOW3-general at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
More information about the FLOW3-general
mailing list