I am using https://github.com/djlambert/doctrine2-spatial and I have an error while trying to query using the "contains" function
first, if I put this:
dql:
numeric_functions:
Contains: CrEOF\Spatial\ORM\Query\AST\Functions\MySql\Contains
in orm as in doc ( https://github.com/djlambert/doctrine2-spatial/blob/master/INSTALL.md ), I have this error:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "dql" under "doctrine.orm"
but if I put it under doctrine.orm.entity_managers.default, there is no error, but I still have an error when starting the request, here is my code:
$sql = 'SELECT DemoTadBundle:DeliveryZone dz WHERE Contains(dz.area, :point)';
$converter = new SpatialConverter();
$q = $this->_em->createQuery($sql)->setParameter('point', $converter->convertToDatabaseValue($address->getPoint()));
return $q->getOneOrNullResult();
and here is the error:
[Semantical Error] line 0, col 41 near 'Contains(dz.area,': Error: Class 'Contains' is not defined.
can someone help me solve this problem?
my symfony version 2.5
thank.
source
share