public function find($className, $id)
    {
        $repo = $this->getRepository($className);

        return $repo->find($id);
    }
public function find($className, $id)
    {
        $repo = $this->getRepository($className);

        return $repo->find($id);
    }
public function find ( $ className , $ id ) { $ repo = $ this -> getRepository ( $ className ) ; return $ repo -> find ( $ id ) ; }
Finds an object by its identifier.

This is just a convenient shortcut for getRepository($className)->find($id).

@param string     $className class name of the object to find
@param int|string $id        identity of the object to find

@throws InvalidRepositoryException

@return object the found object
Finds an object by its identifier .