In order to be able to normalize results, we have to implement additional interface with QueryObject.
- Imatic\Bundle\DataBundle\Data\Query\NormalizeResultQueryObjectInterface
- it has 1 methods
getNormalizerMap- used to describe fields that can be normalized with their type
- it has 1 methods
<?php
use use Doctrine\DBAL\Types\Types;
use Imatic\Bundle\DataBundle\Data\Driver\DoctrineDBAL\QueryObjectInterface;
class UserQuery implements QueryObjectInterface, NormalizeResultQueryObjectInterface
{
// ...
public function getNormalizerMap(): array
{
return [
'birth_date' => Types::DATETIME_MUTABLE,
];
}
}