public function find($id)
    {
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().'.id = '.intval($id))
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
public function find($id)
    {
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().'.id = '.intval($id))
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
public function find ( $ id ) { return $ this -> getQueryBuilder ( ) -> andWhere ( $ this -> getAlias ( ) . '.id = ' . intval ( $ id ) ) -> getQuery ( ) -> getOneOrNullResult ( ) ; }
Finds the resource by his ID.

@param int $id

@return null|object
Finds the resource by his ID .