I have own mini php MVC, and need to add the beberlei/DoctrineExtensions. I am not able to figure out, how to add/configure and to use beberlei/DoctrineExtensions. Currently, i have this configuration :
require_once INC_ROOT . '/vendor/doctrine/common/lib/Doctrine/Common/ClassLoader.php';
use Doctrine\Common\ClassLoader;
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine');
$classLoader->register();
$classLoader2 = new \Doctrine\Common\ClassLoader('DoctrineExtensions', '/vendor/beberlei/DoctrineExtensions');
$classLoader2->register();
I want to select appIds similar to 20aliasApp871, starting with any digit followed by aliasApp string, and then the number higher then 870 ( but there are no more thane 1500).
$appIds = $qb->select( 'a.id' )
->from( 'BookBundle\Entity\App', 'a' )
->where ( ' REGEXP(a.aliasApp, .*aliasApp[189]{1}[0123456789]{2,3}) = true ')
->getQuery()
->getResult();
I am getting Fatal error:
Fatal error: `Uncaught Doctrine\ORM\Query\QueryException:
SELECT a.id FROM BookBundle\Entity\App a WHERE REGEXP(a.aliasApp, .*aliasApp[189]{1}[0123456789]{2,3}) = true`
in vendor\doctrine\orm\lib\Doctrine\ORM\Query\QueryException.php:41 Stack trace:
#0 \vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php(448): Doctrine\ORM\Query\QueryException::dqlError('SELECT a.id FRO...')
#1 vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php(3379): Doctrine\ORM\Query\Parser->syntaxError('known function', Array)
#2 vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php(3351): Doctrine\ORM\Query\Parser->CustomFunctionDeclaration()
#3 vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php(2810): Doctrine\ORM\Query\Parser->FunctionDeclaration()
#4 vendor\doctrine\orm\lib\Doctrine\ORM\Query\QueryException.php on line 52