Example #1
0
 /**
  * 
  * @param type $data
  * @return Model
  */
 protected function load_model($data)
 {
     if ($data == null) {
         return null;
     }
     $model = $this->model->app()->models->factory($this->model_name);
     $model->from_array($data);
     return $model;
 }
Example #2
0
 /**
  * @return Model
  */
 public function get_model()
 {
     $model_name = $this->relation1['model'];
     $model = $this->model1->app()->models->factory($model_name);
     $model->where('_id', 'in', $this->get_ids());
     return $model;
 }
Example #3
0
 public function render(Model $model)
 {
     $content = Form::select($this->name, $this->options, $model->get($this->name), array());
     $layout = $this->get_layout($model->app());
     $layout->name = $this->name;
     $layout->field = $content;
     return $layout->render();
 }