EDIT: Original title" Text environment: "Function "year" does not supported for platform "sqlite""
Incorporating beberlei\DoctrineExtensions in the test environment results in
Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Syntax Error] Function "year" does not supported for platform "sqlite""...
composer show -i includes
beberlei/DoctrineExtensions v1.0.5
The extensions are installed: they exist at "...vendor\beberlei\DoctrineExtensions".
The month() function does NOT throw an error.
config_test.yml
doctrine:
dbal:
default_connection: test
connections:
test:
driver: pdo_sqlite
path: %kernel.cache_dir%/test.sqlite
orm:
dql:
string_functions:
Soundex: Truckee\VolunteerBundle\DQL\Soundex
month: DoctrineExtensions\Query\Sqlite\Month
datetime_functions:
year: DoctrineExtensions\Query\Sqlite\Year
config.yml DQL
dql:
string_functions:
Soundex: Truckee\VolunteerBundle\DQL\Soundex
numeric_functions:
month: Oro\ORM\Query\AST\Functions\SimpleFunction
year: Oro\ORM\Query\AST\Functions\SimpleFunction
function call
public function expiringOppsNotSent()
{
$nextMonth = date_add(new \DateTime(), new \DateInterval('P1M'));
$expiryMonth = date_format($nextMonth, 'm');
$expiryYear = date_format($nextMonth, 'Y');
$qb = $this->getEntityManager()->createQueryBuilder();
$qb->select('o')
->from('TruckeeVolunteerBundle:Opportunity', 'o')
->leftJoin('TruckeeVolunteerBundle:AdminOutbox', 'a', 'WITH', $qb->expr()->eq('a.oppId', 'o'))
->andWhere($qb->expr()->eq('month(o.expireDate)', ':month'))
->andWhere($qb->expr()->eq('year(o.expireDate)', ':year'))
->andWhere('a.id is NULL')
->setParameter(':month', $expiryMonth)
->setParameter(':year', $expiryYear)
;
$notSent = $qb->getQuery()->getResult();
return $notSent;
}
Edit:
The error does not occur if the dql in config.yml (as shown above) are commented out!
Edit #2:
Error persists in functional test with app_dev.php created.
Functional test uses Liip\FunctionalTestBundle\Test\WebTestCase