mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
46 lines
1005 B
PHP
46 lines
1005 B
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2013 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Repositories;
|
|
|
|
use Doctrine\ORM\EntityRepository;
|
|
use Entities\AggregateToken;
|
|
|
|
/**
|
|
* AggregateTokenRepository
|
|
*
|
|
* This class was generated by the Doctrine ORM. Add your own custom
|
|
* repository methods below.
|
|
*/
|
|
class AggregateTokenRepository extends EntityRepository
|
|
{
|
|
/**
|
|
* Finds an AggregateToken based on given User_Adapter.
|
|
*
|
|
* @param \User_Adapter $user
|
|
*
|
|
* @return AggregateToken
|
|
*/
|
|
public function findByUser(\User_Adapter $user)
|
|
{
|
|
$dql = 'SELECT t
|
|
FROM Entities\AggregateToken t
|
|
WHERE t.usr_id = :usr_id';
|
|
|
|
$query = $this->_em->createQuery($dql);
|
|
$query->setParameters(array(
|
|
':usr_id' => $user->get_id())
|
|
);
|
|
|
|
return $query->getOneOrNullResult();
|
|
}
|
|
}
|