public function deleteAction($farmId) { $farm = $this->getFarm($farmId, Acl::PERM_FARMS_DELETE); try { $farm->delete(); } catch (FarmInUseException $e) { throw new ApiErrorException(409, ErrorMessage::ERR_OBJECT_IN_USE, $e->getMessage()); } return $this->result(null); }