Mirza Selimovic
Mirza Selimovic

Reputation: 1739

Doctrine returns result only with empty cache

Hi I'm doing a very simple query with Doctrine but it returns results only when I delete the cache : app/cache/

The problem is not Mysql because I get results with the query that Doctrine makes. I have to find some contacts

    $qb = $repository->createQueryBuilder($alias);

    $qb->select('c');
    $qb->addSelect('cc');
    $qb->addSelect('cp');

    $qb->leftJoin("c.companyContacts", "cc");
    $qb->leftJoin("cc.company", "cp");
    $qb->leftJoin("c.accessions", "a");
    $qb->where('a.createdAt ="2014-08-20"');

It works when I load the page for the first time, then, I have not results. The profiler shows results in the explain of the query :

enter image description here

EDIT

The problem is the date, when I try it with another attribute it works fine.

Upvotes: 0

Views: 128

Answers (1)

Mirza Selimovic
Mirza Selimovic

Reputation: 1739

Solution found: No single or double quotes for dates in Doctrine

Upvotes: 1

Related Questions