Entity/EntityRepository.php
public function getEntity($id, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        return $this->getQueryBuilder(['id' => $id])
            ->getQuery()
            ->setMaxResults(1)
            ->getOneOrNullResult($hydrationMode);
    }
public function getEntity($id, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
    {
        return $this->getQueryBuilder(['id' => $id])
            ->getQuery()
            ->setMaxResults(1)
            ->getOneOrNullResult($hydrationMode);
    }
public function getEntity ( $ id , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { return $ this -> getQueryBuilder ( [ 'id' => $ id ] ) -> getQuery ( ) -> setMaxResults ( 1 ) -> getOneOrNullResult ( $ hydrationMode ) ; }
Returns an entity by its ID.

@param mixed $id
@param integer $hydrationMode
@return mixed

@deprecated Deprecated since 2.0.4; to be removed in 3.0.0. Use the basic `find()` method instead
Returns an entity by its ID .