php - Doctrine Set Multiple Criteria One At A Time Instead Of All At Once -


i'm using kendoui framework grid returns json of users current filter settings.

its result looks filters.

"filter":{"logic":"and","filters":[{"field":"name","operator":"contains","value":"o"},{"field":"name","operator":"startswith","value":"w"}]} 

i need iterate on array , create criteria doctrine filter by. every sample i've seen though shows happening @ once won't work scenario.

i'm using symfony 3.0, code below creates repository.

$repository = $this->getdoctrine()->getrepository('appbundle:company'); 

then rest of code currently.

$company_total = $repository->findall();         $company_records = $repository->findby(array(),$sort,$pagesize,($page-1)*$pagesize);          $data["total"] = count($company_total);          foreach($company_records $company){             $temp["id"]     = $company->getid();             $temp["name"]   = $company->getname();             $temp["phone"]  = $company->getphone();             $temp["email"]  = $company->getemail();             $data["data"][] = $temp;         }          //converts data json         return new jsonresponse($data); 

all code doing returning json response kendo ui grid control knows display. loop on company_records create structure need.

i need apply filters $company_records dynamically , not statically somehow. possible?

resources:

below doing statically in examples

how use complex criteria inside doctrine 2 entity's repository?


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -