/** * Find entity based on identifying parameters. * * @return Entity */ protected function getEntity() { // Entity will be loaded using the provided id $id = $this->getRequiredIdentifier('id'); // ... attempt to load the entity $entity = $this->repo->get($id); // ... and verify that the entity was actually loaded $this->verifyEntityLoaded($entity, compact('id')); // ... then return it return $entity; }