[Flow] Update Domain object which has value objects as its property

Dominique Feyer dfeyer at ttree.ch
Thu Oct 9 09:31:53 CEST 2014


First you don’t need to specify the targetEntity, Flow will do that for your based on the @var annotation.

If Expence is a ValueObject … maybe the relation need to be OneToMany … without that I think your design is wrong. An Expense can only be attached to a single application. 

Bests,

--   
ttree sàrl  
Dominique Feyer  
Rue du Valentin 34 et demi
CH - 1004 Lausanne
+41 21  312 36 35  
dfeyer at ttree.ch
ttree.ch - @ttreeagency - plan d’accès

Le 9 octobre 2014 à 05:55:03, Rocky (rockysynergy at gmail.com) a écrit:

Hi,  

The AbstractApplication has many expenses. Expense is value object. Thus I have below annotation:  

/**  
* @var \Doctrine\Common\Collections\Collection<\Hwwcn\Sponsor\Domain\Model\Expense>  
* @ORM\ManyToMany(targetEntity="\Hwwcn\Sponsor\Domain\Model\Expense")  
*/  
protected $expenses;  

When I try to edit an Application, I got error saying: An exception occurred while executing 'INSERT INTO hwwcn_sponsor_domain_model_abstractapplication_expenses_join (sponsor_abstractapplication, hwwcn_model_expense) VALUES (?, ?)' with params ["b035cc35-ee1a-d812-dee8-f3d974fee4ce", "393834dac2c6652171b4cc790fdb8fc961d01d9d"]:  
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'b035cc35-ee1a-d812-dee8-f3d974fee4ce-393834dac2c6652171b4cc790fd' for key 'PRIMARY'  

Any idea how can I solve this problem 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