mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Avoid using getPartialReference
This commit is contained in:
28
lib/classes/patchAbstract.php
Normal file
28
lib/classes/patchAbstract.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2014 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Doctrine\ORM\EntityManager;
|
||||
|
||||
abstract class patchAbstract implements patchInterface
|
||||
{
|
||||
protected function loadUser(EntityManager $em, $usrId)
|
||||
{
|
||||
try {
|
||||
return $em->createQuery('SELECT PARTIAL u.{id} FROM Phraseanet:User u WHERE u.id = :id')
|
||||
->setParameters(['id' => $usrId])
|
||||
->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true)
|
||||
->getSingleResult();
|
||||
} catch (NoResultException $e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user