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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

html - Repeat image to extend header to fill screen -

javascript - Backbone.js getting target attribute -