Top "Dql" questions

Doctrine Query Language (DQL) is an Object Query Language created for helping users in complex object retrieval.

Symfony2 and Doctrine - Error: Invalid PathExpression. Must be a StateFieldPathExpression

I have an entity that looks like this: /** * @Gedmo\Tree(type="nested") * @ORM\Table(name="categories") * @ORM\Entity() */ class Category …

symfony doctrine-orm dql
How to specify null value as filter in a Doctrine query?

I am using Doctrine 1.1 in Zend. I am trying to write a query that will return records that have a …

php null doctrine dql
Symfony getting logged in user's id

I am developing an application using Symfony2 and doctrine 2. I would like to know how can I get the currently …

symfony doctrine-orm dql
Symfony2 Doctrine querybuilder where IN

I losted trilion hours google this but none of the solutions were good. I have this querybuilder: $qb2=$this->…

doctrine dql query-builder
How to select randomly with doctrine

Here is how I query my database for some words $query = $qb->select('w') ->from('DbEntities\Entity\…

php doctrine-orm dql
Using JOIN in Symfony2/Doctrine SQL

I have a problem while trying to USE QueryBuilder OR DQL. I have the following relation: User <-1:n-&…

php symfony doctrine dql query-builder
Doctrine 2: Query result as associative array

In my Repository class I use the following code to query: $query = $this->getEntityManager()->createQuery(" SELECT s.…

php doctrine doctrine-orm dql
Symfony 2 Doctrine find by ordered array of id

I'm looking for a way to use Doctrine in Symfony 2 to find items using an ordered array of id. I …

php symfony doctrine dql
custom query in entity field type

I build a form with entity type like this: $form = $this->createFormBuilder() ->add('users', 'entity', array( 'class' =&…

symfony entity dql
How to do a LIKE database query in Symfony2

This should be simple but I can't find a working example. Here's a controller method that throws the error "Invalid …

symfony doctrine-orm doctrine query-builder dql