Example #1
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aParent) {
         $this->aParent->removeLocalizationRelatedById($this);
     }
     if (null !== $this->aLanguage) {
         $this->aLanguage->removeLocalizationRelatedByLanguageId($this);
     }
     if (null !== $this->aExtLang) {
         $this->aExtLang->removeLocalizationRelatedByExtLanguageId($this);
     }
     if (null !== $this->aScript) {
         $this->aScript->removeLocalization($this);
     }
     $this->id = null;
     $this->parent_id = null;
     $this->name = null;
     $this->locale = null;
     $this->language_id = null;
     $this->ext_language_id = null;
     $this->region = null;
     $this->script_id = null;
     $this->is_default = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }