src/Kunstmaan/NodeBundle/Repository/NodeTranslationRepository.php
public function getNodeTranslationByNodeIdQueryBuilder($nodeId, $lang)
    {
        $qb = $this->createQueryBuilder('nt')
            ->select('nt')
            ->innerJoin('nt.node', 'n', 'WITH', 'nt.node = n.id')
            ->where('n.deleted != 1')
            ->andWhere('nt.online = 1')
            ->andWhere('nt.lang = :lang')
            ->setParameter('lang', $lang)
            ->andWhere('n.id = :node_id')
            ->setParameter('node_id', $nodeId)
            ->setFirstResult(0)
            ->setMaxResults(1);

        return $qb->getQuery()->getOneOrNullResult();
    }
public function getNodeTranslationByNodeIdQueryBuilder($nodeId, $lang)
    {
        $qb = $this->createQueryBuilder('nt')
            ->select('nt')
            ->innerJoin('nt.node', 'n', 'WITH', 'nt.node = n.id')
            ->where('n.deleted != 1')
            ->andWhere('nt.online = 1')
            ->andWhere('nt.lang = :lang')
            ->setParameter('lang', $lang)
            ->andWhere('n.id = :node_id')
            ->setParameter('node_id', $nodeId)
            ->setFirstResult(0)
            ->setMaxResults(1);

        return $qb->getQuery()->getOneOrNullResult();
    }
public function getNodeTranslationByNodeIdQueryBuilder ( $ nodeId , $ lang ) { $ qb = $ this -> createQueryBuilder ( 'nt' ) -> select ( 'nt' ) -> innerJoin ( 'nt.node' , 'n' , 'WITH' , 'nt.node = n.id' ) -> where ( 'n.deleted != 1' ) -> andWhere ( 'nt.online = 1' ) -> andWhere ( 'nt.lang = :lang' ) -> setParameter ( 'lang' , $ lang ) -> andWhere ( 'n.id = :node_id' ) -> setParameter ( 'node_id' , $ nodeId ) -> setFirstResult ( 0 ) -> setMaxResults ( 1 ) ; return $ qb -> getQuery ( ) -> getOneOrNullResult ( ) ; }
Get the QueryBuilder based on node id and language.

@param int    $nodeId
@param string $lang

@return array_shift($result)
Get the QueryBuilder based on node id and language .