Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 /**
  * Check whether a language may be deleted
  *
  * @param int $id
  *
  * @return boolean
  */
 public function canDeleteLanguage($id)
 {
     try {
         return $this->innerGateway->canDeleteLanguage($id);
     } catch (DBALException $e) {
         throw new RuntimeException('Database error', 0, $e);
     } catch (PDOException $e) {
         throw new RuntimeException('Database error', 0, $e);
     }
 }