/** * Deletes a policy * * Used by {@link removePolicy()} and {@link deletePolicy()} * * @param APIPolicy $policy * * @throws \Exception * * @return void */ protected function internalDeletePolicy(APIPolicy $policy) { $this->repository->beginTransaction(); try { $this->userHandler->deletePolicy($policy->id); $this->repository->commit(); } catch (Exception $e) { $this->repository->rollback(); throw $e; } }