Пример #1
0
Файл: Wms.php Проект: Gnafu/wiz
 public static function getLayers()
 {
     $layers = Wms::model()->findAllByAttributes(array('username' => Yii::app()->user->id));
     $return = array();
     foreach ($layers as $i => $l) {
         $return[] = array('name' => $l->name, 'title' => $l->title, 'url' => $l->url, 'projection' => $l->projection);
     }
     return $return;
 }
Пример #2
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param string $id the identifier of the model to be loaded
  */
 public function loadModel($name)
 {
     $model = Wms::model()->findByPk(array('username' => Yii::app()->user->id, 'name' => $name));
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }