protected function saveBackdropAwareEntityChanges(BackdropEntityAware $entity) { if ($entity instanceof Profile) { $this->profileService->saveProfile($entity); } else { throw new \Exception('Invalid entity: unable to save entity'); } }