when I want to update a row by identifier:

$something = $em->find('Entities\Something', $_POST['id']);
$something->setFields($_POST, array('blah'));
then flush... It works fine.

But findBy is not valid for entity, but only for repository.

$something =
$em->getRepository('Repository\Something')->findBy(array('productId' =>
$_POST['productId']));
it seems I have a repository file as Something.php and it seems something
is found but how can I set fields to be updated? just adding a function
setFields() in repository file like the one in entity file, will not work...
$something->setFields($_POST, array('blah'));
Please advice how can I update/flush an updated entity using ->findBy
rather than ->find? I was unable to find this in wiki nor in API.
Hope to get an answer from you, please help. No info in wiki about this.

-- 
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