diff --git a/src/Application.php b/src/Application.php index 068951c..44a81c5 100644 --- a/src/Application.php +++ b/src/Application.php @@ -57,6 +57,23 @@ class Application { // $em_config->setQueryCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); // $em_config->setResultCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); // $em_config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); + $em_config->setCustomNumericFunctions(array( + 'ACOS' => 'DoctrineExtensions\Query\Mysql\Acos', + 'ASIN' => 'DoctrineExtensions\Query\Mysql\Asin', + 'ATAN' => 'DoctrineExtensions\Query\Mysql\Atan', + 'ATAN2' => 'DoctrineExtensions\Query\Mysql\Atan2', + 'BIT_COUNT' => 'DoctrineExtensions\Query\Mysql\BitCount', + 'BIT_XOR' => 'DoctrineExtensions\Query\Mysql\BitXor', + 'COS' => 'DoctrineExtensions\Query\Mysql\Cos', + 'COT' => 'DoctrineExtensions\Query\Mysql\Cot', + 'DEGREES' => 'DoctrineExtensions\Query\Mysql\Degrees', + 'LOG10' => 'DoctrineExtensions\Query\Mysql\Log10', + 'RADIANS' => 'DoctrineExtensions\Query\Mysql\Radians', + 'STDDEV' => 'DoctrineExtensions\Query\Mysql\StdDev', + 'SIN' => 'DoctrineExtensions\Query\Mysql\Sin', + 'TAN' => 'DoctrineExtensions\Query\Mysql\Tan', + 'RAND' => 'DoctrineExtensions\Query\Mysql\Rand', + )); $connectionConfig = new Configuration(); $connectionParams = array( @@ -92,6 +109,8 @@ class Application { $_em->getEventManager()->addEventSubscriber(new \Gedmo\SoftDeleteable\SoftDeleteableListener()); $_em->getEventManager()->addEventSubscriber(new \Gedmo\Timestampable\TimestampableListener()); + + $this->em = $_em; }