Controller_Data::loadById PHP Метод

loadById() абстрактный публичный Метод

Locate and load data for a specified record. If data backend supports selective loading of fields, you may call model->getActualFields to get a list of required fields for a model. When non-array is returned, you should load all fields.
abstract public loadById ( $model, $id )
    public abstract function loadById($model, $id);

Usage Example

Пример #1
0
 /**
  * Like tryLoad method but if the record not found, an exception is thrown.
  *
  * @param $id
  *
  * @return $this
  */
 public function load($id)
 {
     if (!$this->controller) {
         throw $this->exception('Unable to load model, setSource() must be set');
     }
     if ($this->loaded()) {
         $this->unload();
     }
     $this->hook('beforeLoad', array('load', array($id)));
     $this->controller->loadById($this, $id);
     $this->endLoad();
     return $this;
 }