i dont know how to integrate the beberlei doctrine-extensions: https://github.com/beberlei/DoctrineExtensions in Zend Framework 2 with Doctrine Module. I installed it with composer:
"beberlei/DoctrineExtensions": "dev-master"
I tried in my module.config.php from th application module:
'doctrine' => array(
'driver' => array(
__NAMESPACE__ .'_driver' => array(
'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
'cache' => 'array',
'paths' => array(__DIR__ . '/../src/'.__NAMESPACE__.'/Entity')
),
'orm_default' => array(
'drivers' => array(
__NAMESPACE__.'\Entity' => __NAMESPACE__. '_driver'
)
)
),
'configuration' => array(
'orm_default' => array(
'string_functions' => array(
'GroupConcat' => '/vendor/beberlei/DoctrineExtensions\Query\MsySql\GroupConcat'
)
)
)
),
but this Exception was thrown:
Fatal error: Class '/vendor/beberlei/DoctrineExtensions\Query\MsySql\GroupConcat' not found
After installing with Composer
use this code in your service class:
now you can use 'GROUP_CONCAT' in your DQL like this:
The configuration doesn't need to reference the
/vendor/beberlei
folder as this is handled by the autoloader. The configuration should probably look something like this :It worked for me by
1- install DoctrineExtensions with composer
2- Add this line to autoload_classmapp.php
3- Add this to module.config.php
My reputation is too low to comment but:
should be:
notice the Mysql instead of MsySql