3 namespace Rapsys\AirBundle\Repository
;
5 use Symfony\Component\Translation\TranslatorInterface
;
6 use Doctrine\ORM\Query\ResultSetMapping
;
11 class SnippetRepository
extends \Doctrine\ORM\EntityRepository
{
13 * Find snippets by locale and user id
15 * @param string $locale The locale
16 * @param User|int $user The user
17 * @return array The snippets or empty array
19 public function findByLocaleUserId($locale, $user) {
21 $ret = $this->getEntityManager()
22 ->createQuery('SELECT s FROM RapsysAirBundle:Snippet s WHERE s.locale = :locale and s.user = :user')
23 ->setParameter('locale', $locale)
24 ->setParameter('user', $user)