src/Controller/CrudController.php
protected function findObject(Request $request, $id)
    {
        $configuration = $this->getConfiguration($request);

        if (!($object = $this->getRepository()->find($id))) {
            throw $this->createNotFoundException(
                sprintf('Object %s(%s) not found', $configuration->getEntityClass(), $id)
            );
        }

        return $object;
    }
protected function findObject(Request $request, $id)
    {
        $configuration = $this->getConfiguration($request);

        if (!($object = $this->getRepository()->find($id))) {
            throw $this->createNotFoundException(
                sprintf('Object %s(%s) not found', $configuration->getEntityClass(), $id)
            );
        }

        return $object;
    }
protected function findObject ( Request $ request , $ id ) { $ configuration = $ this -> getConfiguration ( $ request ) ; if ( ! ( $ object = $ this -> getRepository ( ) -> find ( $ id ) ) ) { throw $ this -> createNotFoundException ( sprintf ( 'Object %s(%s) not found' , $ configuration -> getEntityClass ( ) , $ id ) ) ; } return $ object ; }
Find an object by ID

@param mixed $id
@return object
@throws NotFoundHttpException
Find an object by ID