symfony - How we can write IN statement in where condition of Doctine -
i have array of category , want use in statement in class using doctrine . idea.?
you can use
public function searchcategory($target){//$target aray(1,2,3) $query = $this->getentitymanager() ->createquery("select abc ct.target target adminbundle:clothingtype ct ct.target in (:target)") ->setparameter('target',$target['target']);// can change ur requirment try { return $query->getresult(); } catch (\doctrine\orm\noresultexception $e) { return null; }
}
Comments
Post a Comment