eZ\Publish\Core\Repository\LanguageService::deleteLanguage PHP Method

deleteLanguage() public method

Deletes a language from content repository.
public deleteLanguage ( eZ\Publish\API\Repository\Values\Content\Language $language )
$language eZ\Publish\API\Repository\Values\Content\Language
    public function deleteLanguage(Language $language)
    {
        if ($this->repository->hasAccess('content', 'translations') !== true) {
            throw new UnauthorizedException('content', 'translations');
        }
        $loadedLanguage = $this->loadLanguageById($language->id);
        $this->repository->beginTransaction();
        try {
            $this->languageHandler->delete($loadedLanguage->id);
            $this->repository->commit();
        } catch (LogicException $e) {
            $this->repository->rollback();
            throw new InvalidArgumentException('language', $e->getMessage(), $e);
        } catch (Exception $e) {
            $this->repository->rollback();
            throw $e;
        }
    }