image我有以下数据库结构
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
如果我想一次查找几个项目,检查列是否存在,会发生什么
就像是
$dummy = findOneBy('voterid'=>1,'imageid'=>2,action=>"upvote"); if($dummy) { //column exists! }
这可能吗?
见
Databases and Doctrine
原文链接:https://www.f2er.com/php/136707.html如果要检索产品,关于某些属性,您只需使用方法findOneBy作为参数作为数组:
$product = $repository->findOneBy(array('name' => 'foo','price' => 19.99));