In Doctrine you can create DQL in 2 ways:
EntityManager::createQuery:
$query = $em->createQuery( SELECT u FROM MyProjectModelUser u WHERE u.id = ?1 );
QueryBuilder:
$qb->add( select , u )
->add( from , User u )
->add( where , u.id = ?1 )
->add( orderBy , u.name ASC );
I wonder what the difference is and which should I use?