public function loadModel($id) { $model = ProMasterFurnished::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
public static function getInforFurnishedBYId($id, $field = 'name') { $model = ProMasterFurnished::model()->findByPk($id); if ($model) { return $model->{$field}; } }
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; }