Пример #1
0
 public function loadModel($id)
 {
     $model = ProMasterFurnished::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Пример #2
0
 public static function getInforFurnishedBYId($id, $field = 'name')
 {
     $model = ProMasterFurnished::model()->findByPk($id);
     if ($model) {
         return $model->{$field};
     }
 }
Пример #3
0
 protected static function parseFurnished($value)
 {
     $data = CHtml::listData(ProMasterFurnished::model()->findAll(), 'value', 'name');
     $t = array_search(strtolower($value), array_map('strtolower', $data));
     return $t ?: null;
 }