Exemplo n.º 1
0
 /**
  * Removes a translation with language $languageCode
  *
  * @param string $languageCode (nor-NO, eng-GB)
  * @return void
  */
 public function removeTranslation($languageCode)
 {
     // Log in as admin first because removeTranslation() checks for permissions.
     $adminUser = eZUser::fetch(14);
     $adminUser->loginCurrent();
     $language = eZContentLanguage::fetchByLocale($languageCode, false);
     $success = $this->object->removeTranslation($language->attribute('id'));
     if (!$success) {
         throw new Exception("Unable to remove translation {$languageCode}");
     }
     // $this->publish();
 }