/** * Delete a language. * * @param mixed $id * * @throws LogicException If language could not be deleted */ public function delete($id) { if (!$this->languageGateway->canDeleteLanguage($id)) { throw new LogicException("Deleting language logic error, some content still references that language and therefore it can't be deleted"); } $this->languageGateway->deleteLanguage($id); }
/** * Deletes the language with $id * * @param int $id * * @return void */ public function deleteLanguage($id) { try { return $this->innerGateway->deleteLanguage($id); } catch (DBALException $e) { throw new RuntimeException('Database error', 0, $e); } catch (PDOException $e) { throw new RuntimeException('Database error', 0, $e); } }