Another thing: if you get back a *collection *of Something*s*, it would be 
more clear if you name that variable in *plural*, like is done with $user*s*in 
http://docs.doctrine-project.org/en/2.0.x/reference/working-with-objects.html#by-simple-conditions

On Sunday, 9 March 2014 19:55:49 UTC+1, Herman Peeren wrote:
>
> Yes, that is what I said: you have to loop over the collection (so: use a 
> foreach). 
>
> You can leave the persist( ) away, for the entities are allready in your 
> Unit of Work. 
>
> On Sunday, 9 March 2014 19:47:32 UTC+1, Parsifal wrote:
>>
>>  
>> No, there is not only one row to be updated, there might be serveral...
>> If I use Repository->findBy( ), then I get an error for undefined method 
>> setFields() I said previously, but this method is in my entity file, and 
>> for sure I added in repository file and I am still gettig that error, 
>> please advice how can I setFields for collections of entities returned by 
>> findBy()?
>>  
>> should I use something like this below?
>> $something = 
>> $em->getRepository('Entities\Something')->findBy(array('productId' => 
>> $_POST['productId']));
>> foreach ($something as $blah)  {
>>                $s = $blah->setFields(.....); 
>>                $blah->persist( $s);
>> }
>> and flush() here.
>>  
>> Is it something right? please advice.
>>  
>>  
>>  
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to