Convert sql to doctrine symfony or DQL -


hello have 2 many 1 relation in database , use sql query ok can`t convert query mysql dql or querybuilder please me

select *  `resturant` left join `food`     on `resturant`.`id` = `food`.`resturant_id`  `food`.`name`like "%pizza%"  group `resturant`.`name` 

assuming restaurant entity linked food entity through attribute $foods:

$this->createquerybuilder('restaurant')     ->leftjoin('restaurant.foods', 'food')     ->where('food.name %pizza%')     ->groupby('restaurant.name')     ->getquery()->getresult(); 

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -