<?php

namespace Alchemy\Phrasea\Model\Repositories;

use Alchemy\Phrasea\Model\Entities\ApiAccount;
use Doctrine\ORM\EntityRepository;

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

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