Пример #1
0
 /**
  * @param null $id
  */
 function load($id = null)
 {
     parent::load($id);
     if ($this->_id) {
         $this->exist = true;
     }
     return $this;
 }
 /**
  * Load target of meta object
  *
  * @param bool $cache Utilisation du cache
  *
  * @return CMbObject
  */
 function loadTargetObject($cache = true)
 {
     if ($this->_ref_object || !$this->object_class) {
         return $this->_ref_object;
     }
     if (!class_exists($this->object_class)) {
         $ex_object = CExObject::getValidObject($this->object_class);
         if (!$ex_object) {
             CModelObject::error("Unable-to-create-instance-of-object_class%s-class", $this->object_class);
             return null;
         } else {
             $ex_object->load($this->object_id);
             $this->_ref_object = $ex_object;
         }
     } else {
         $this->_ref_object = $this->loadFwdRef("object_id", $cache);
     }
     if (!$this->_ref_object->_id) {
         $this->_ref_object->load(null);
         $this->_ref_object->_view = "Element supprimé";
     }
     return $this->_ref_object;
 }