<?php

namespace Alchemy\Phrasea\Model\Repositories;

use Doctrine\ORM\EntityRepository;

/**
 * ApiOauthRefreshTokenRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ApiOauthRefreshTokenRepository extends EntityRepository
{
    public function findByAccount(ApiAccount $account)
    {
        $qb = $this->createQueryBuilder('rt');
        $qb->where($qb->expr()->eq('rt.account', ':account'));
        $qb->setParameter(':account', $account);

        return $qb->getQuery()->getResult();
    }
}
