Exemplo n.º 1
0
 public function clearAliases()
 {
     if ($this->id > 0) {
         $objContentLangs = ContentLanguage::select();
         foreach ($objContentLangs as $objContentLanguage) {
             $objAliases = Alias::selectByUrl($this->id, $objContentLanguage->getId());
             if (is_object($objAliases)) {
                 foreach ($objAliases as $objAlias) {
                     $objAlias->delete();
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
 public function clearAliases()
 {
     if ($this->id > 0) {
         //*** Also delete the aliases with language 0 (All languages).
         $arrLanguageIds = array(0);
         //*** Get the rest of the languages.
         $objContentLangs = ContentLanguage::select();
         foreach ($objContentLangs as $objContentLanguage) {
             array_push($arrLanguageIds, $objContentLanguage->getId());
         }
         foreach ($arrLanguageIds as $intLanguageId) {
             $objAliases = Alias::selectByUrl($this->id, $intLanguageId);
             if (is_object($objAliases)) {
                 foreach ($objAliases as $objAlias) {
                     $objAlias->delete();
                 }
             }
         }
     }
 }