Doctrine/ORM/EntityRepository.php
public function find($id)
    {
        if(is_array($id) && isset($id['id'])){
            $id = $id['id'];
        }
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().".id = '".$id."'")
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
public function find($id)
    {
        if(is_array($id) && isset($id['id'])){
            $id = $id['id'];
        }
        return $this
            ->getQueryBuilder()
            ->andWhere($this->getAlias().".id = '".$id."'")
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
@param mixed $id

@return null|object