mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 20:43:25 +00:00
Add token entities and repositories
This commit is contained in:
29
lib/Doctrine/Repositories/AggregateTokenRepository.php
Normal file
29
lib/Doctrine/Repositories/AggregateTokenRepository.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Repositories;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Entities\Feed;
|
||||
|
||||
/**
|
||||
* AggregateTokenRepository
|
||||
*
|
||||
* This class was generated by the Doctrine ORM. Add your own custom
|
||||
* repository methods below.
|
||||
*/
|
||||
class AggregateTokenRepository extends EntityRepository
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user