Is it possible to find columns using multiple values in Doctrine and Symfony2?
doctrine-orm, php, symfony
Solution
See Databases and Doctrine
If you want to retrieve a product, regarding some properties, you just have to use the method `findOneBy` with as parameters an array :
$product = $repository->findOneBy(array('name' => 'foo', 'price' => 19.99));
Problem
image I have the following database structure ``` class voters { protected $voterid; protected $imageid; protected $action; } // $voterid = is the current voter // $imageid = is the id of the voted image // $action = is upvote/downvote,delete ``` what happens if I want to look for several items at once, to check if a column exists, something like ``` $dummy = findOneBy('voterid'=>1,'imageid'=>2,action=>"upvote"); if($dummy) { //column exists! } ``` Is this possible?