/** * Delete a Land entity */ public function deleteAction() { if ($this->request->hasArgument('uUID')) { $uuid = $this->request->getArgument('uUID'); } if (empty($uuid)) { $this->throwStatus(400, 'Required uUID not provided', null); } $lands = count($this->ortRepository->findByLand($uuid)); if ($lands == 0) { $landObj = $this->landRepository->findByIdentifier($uuid); if (!is_object($landObj)) { $this->throwStatus(400, 'Entity Land not available', null); } $this->landRepository->remove($landObj); $this->throwStatus(200, null, null); } else { $this->throwStatus(400, 'Due to dependencies Land entity could not be deleted', null); } }