Questions tagged as 'dql'

1
answer

How to make a purchase matrix in DQL or MYSQL

I would like to create a matrix with two tables in sql in the following way: I have a table that contains the data: id | name 00 | Form 0 01 | Form 1 02 | Form 2 03 | Form 3 04 | Form 4 another table: id | name 00 | person...
asked by 09.07.2018 / 07:52
1
answer

How to show a form in Symfony from a query to 2 entities

I have the following code that works: //AdminController.php $orders_repo=$em->getRepository("BackendBundle:Orders"); $order=$orders_repo->getQuery()->getResult(); $form = $this->createForm(OrderType::class, $order); And in the O...
asked by 03.08.2017 / 03:17
0
answers

erroneous behavior of the knp paginator bundle

I have two queries dql which I am paging with the knp paginator bundle. One for a generic search and another for the advanced search. public function returnGenericSearchData(Request $request) { $em = $this->em; $container = $this-&g...
asked by 13.11.2018 / 16:25
0
answers

How do I perform a dql query to join 4 tables

I am using the knp paginator bundle in my system in Symfony 4, for which I need to perform queries using dql. I have 5 entities, House, Package, Day, Actividade and Image. The houses have a direct relationship with the images. Each House has...
asked by 07.11.2018 / 19:33
0
answers

"Select from (Select" Subquery a doctrine dql

I have made a query to the database to get the actual availability of the rooms of several hotels but when trying to make the query with doctrine in symfony 3.4, I get an error. This is the query: SELECT (CASE WHEN count(_days) > 0 THEN...
asked by 08.06.2018 / 10:39
2
answers

help with symfony query 3

Hello it turns out that I'm working on a project in symfony 3.3 and I have an Entity that has fields like title (string) auto (boolean) createdAt (datetime) ftope (datetime), this last is a deadline and I would like to make a query...
asked by 26.01.2018 / 21:13
1
answer

subConsulta select transformed to DQL

I am using MySQL and I have this select : Select TOP 15 Item DescriptionforSales , (select top 1 Retail from Pricelist where Pricelist.peachitemid = products.peachitemid ) as Retail " From products where imagen=1 and active=1...
asked by 26.11.2017 / 23:17
1
answer

show in twig the result of a JOIN query in Symfony

I have 2 tables which are not related by ORM so I do the JOIN in the following way: $dql="Select u, o from BackendBundle:Orders o JOIN BackendBundle:Users u WITH o.userid=u.id"; $query=$em->createQuery($dql);...
asked by 01.08.2017 / 19:39
2
answers

Error to edit a record in Symfony

I have a relationship between 2 tables Orders and Users and the information is displayed correctly. Mapping Users: BackendBundle\Entity\Users: type: entity table: users id: id: type: integer nullable: false...
asked by 02.08.2017 / 19:24
1
answer

JOIN error with Symfony

I have a relationship between 2 Orders and Users tables from the field user_id and id respectively. I make this query: $dql="SELECT u, o FROM BackendBundle:Orders o JOIN o.users u"; $query=$em->createQuery($dql)...
asked by 02.08.2017 / 05:30