Doctrine Secrets ... for me ))) from StackOverflow and other Internet resources
Doctrine Secrets
Temporarily change fetch mode in DQL - sometimes its useful
Symfony2 and Doctrine - Error: Invalid PathExpression. Must be a StateFieldPathExpression
You can use the currently undocumentedIDENTITY
function to select the FK IDs in a query: SELECT IDENTITY(c.parent) ... or you must do $
qb->innerJoin("c.parent", "p")Left join ON condition AND other condition syntax in Doctrine
use Doctrine\ORM\Query\Expr;
->leftJoin('a.installations', 'i', Expr\Join::WITH, 'i.page = :page')
->setParameter('page', $page)
Count Rows in Doctrine QueryBuilder
$qb = $entityManager->createQueryBuilder();
$qb->select('count(account.id)');
$qb->from('ZaysoCoreBundle:Account','account');
$count = $qb->getQuery()->getSingleScalarResult();
Comments