Esempio n. 1
0
 public function delete($accountId = NULL)
 {
     global $_CONF;
     self::$object = "ContentLanguage";
     self::$table = "pcms_language";
     //*** Remove all field values for this language.
     $objElements = Element::select();
     foreach ($objElements as $objElement) {
         $objFields = $objElement->getFields();
         foreach ($objFields as $objField) {
             $objValue = $objField->getValueObject($this->id);
             $objValue->delete();
         }
     }
     //*** Remove all elements linked to this language.
     ElementLanguage::deleteByLanguage($this->getId());
     if (class_exists("AuditLog")) {
         AuditLog::addLog(AUDIT_TYPE_LANGUAGE, $this->getId(), $this->getName(), "delete");
     }
     return parent::delete($accountId);
 }