<?php

namespace AdminBundle\Repository;

use Doctrine\ORM\EntityRepository;

class StudioRepository extends EntityRepository {

    public function findOneByLanguage($language) {
        return $this->createQueryBuilder('s')
            ->select('s')
            ->innerJoin('s.language', 'l', 'WITH', 'l.isoCode = :language')
            ->setParameter('language', $language)
            ->getQuery()
            ->getSingleResult();
    }

}