X-Git-Url: https://git.rapsys.eu/.gitweb.cgi/blogbundle/blobdiff_plain/c58e92206eb218d8a608e66f387c3f7df54624a1..f3ed0993bc1b41cee9f20c762889c54e8a8110ca:/Repository/UserRepository.php diff --git a/Repository/UserRepository.php b/Repository/UserRepository.php index 71b6cd1..0a385bf 100644 --- a/Repository/UserRepository.php +++ b/Repository/UserRepository.php @@ -12,6 +12,9 @@ namespace Rapsys\BlogBundle\Repository; use Doctrine\ORM\Query\ResultSetMapping; + +use Rapsys\BlogBundle\Repository; + use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface; use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; @@ -19,7 +22,7 @@ use Symfony\Component\Security\Core\User\PasswordUpgraderInterface; /** * UserRepository */ -class UserRepository extends EntityRepository implements PasswordUpgraderInterface { +class UserRepository extends Repository implements PasswordUpgraderInterface { /** * Find user count as int * @@ -45,7 +48,7 @@ SQL; $rsm->addScalarResult('count', 'count', 'integer'); //Get result - return $this->_em + return $this->manager ->createNativeQuery($req, $rsm) ->getSingleScalarResult(); } @@ -151,9 +154,9 @@ SQL; ->addScalarResult('surname', 'surname', 'string') ->addScalarResult('pseudonym', 'pseudonym', 'string') ->addScalarResult('slug', 'slug', 'string') - ->addScalarResult('created', 'created', 'datetime') - ->addScalarResult('updated', 'updated', 'datetime') - ->addScalarResult('modified', 'modified', 'datetime') + ->addScalarResult('created', 'created', 'datetime_immutable') + ->addScalarResult('updated', 'updated', 'datetime_immutable') + ->addScalarResult('modified', 'modified', 'datetime_immutable') ->addScalarResult('civility', 'civility', 'string') //XXX: is a string because of \n separator ->addScalarResult('g_ids', 'g_ids', 'string') @@ -175,7 +178,7 @@ SQL; ->addScalarResult('kt_titles', 'kt_titles', 'string'); //Fetch result - $res = $this->_em + $res = $this->manager ->createNativeQuery($req, $rsm) ->setParameter('offset', $page * $count) ->setParameter('count', $count) @@ -377,9 +380,9 @@ SQL; ->addScalarResult('surname', 'surname', 'string') ->addScalarResult('pseudonym', 'pseudonym', 'string') ->addScalarResult('slug', 'slug', 'string') - ->addScalarResult('created', 'created', 'datetime') - ->addScalarResult('updated', 'updated', 'datetime') - ->addScalarResult('modified', 'modified', 'datetime') + ->addScalarResult('created', 'created', 'datetime_immutable') + ->addScalarResult('updated', 'updated', 'datetime_immutable') + ->addScalarResult('modified', 'modified', 'datetime_immutable') ->addScalarResult('civility', 'civility', 'string') //XXX: is a string because of \n separator ->addScalarResult('g_ids', 'g_ids', 'string') @@ -401,7 +404,7 @@ SQL; ->addScalarResult('kt_titles', 'kt_titles', 'string'); //Get data - if (($data = $this->_em + if (($data = $this->manager ->createNativeQuery($req, $rsm) ->setParameter('id', $id) ->getOneOrNullResult()) === null) {