예제 #1
0
파일: FaktaSearch.php 프로젝트: haydiru/GIS
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Fakta::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'tahun' => $this->tahun, 'id_user' => \Yii::$app->user->identity->id, 'id_bulan' => $this->id_bulan, 'id_variabel' => $this->id_variabel, 'id_kategori' => $this->id_kategori, 'id_item_kategori' => $this->id_item_kategori, 'id_sumber_data' => $this->id_sumber_data, 'nilai' => $this->nilai]);
     $query->andFilterWhere(['like', 'id_wilayah', $this->id_wilayah])->andFilterWhere(['like', 'kode_unik', $this->kode_unik]);
     return $dataProvider;
 }
예제 #2
0
파일: Variabel.php 프로젝트: haydiru/GIS
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFaktas()
 {
     return $this->hasMany(Fakta::className(), ['id_variabel' => 'id']);
 }
예제 #3
0
파일: SumberData.php 프로젝트: haydiru/GIS
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFaktas()
 {
     return $this->hasMany(Fakta::className(), ['id_sumber_data' => 'id']);
 }
예제 #4
0
파일: Wilayah.php 프로젝트: haydiru/GIS
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFaktas()
 {
     return $this->hasMany(Fakta::className(), ['id_wilayah' => 'id']);
 }
예제 #5
0
 /**
  * Finds the Fakta model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Fakta the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Fakta::findOne(['id' => $id, 'id_user' => \Yii::$app->user->identity->id])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #6
0
파일: Kategori.php 프로젝트: haydiru/GIS
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getFaktas()
 {
     return $this->hasMany(Fakta::className(), ['id_kategori' => 'id']);
 }