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;
    }