コード例 #1
0
 /**
  * Finds the Matvid model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Matvid the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Matvid::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #2
0
ファイル: MatvidSearch.php プロジェクト: vovancho/yii2test
 public function searchforgrupavid($params)
 {
     $query = Matvid::find();
     $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['matvid_name' => SORT_ASC]]]);
     $query->joinWith(['grupavids']);
     $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(['matvid_id' => $this->matvid_id]);
     $query->andFilterWhere(['like', 'matvid_name', $this->matvid_name]);
     $query->andFilterWhere(['like', 'grupavids.grupa_main', $this->getAttribute('grupavids.grupa_main')]);
     Proc::AssignRelatedAttributes($dataProvider, ['grupavids.grupa_main']);
     return $dataProvider;
 }
コード例 #3
0
 /**
  * @depends loadData
  */
 public function destroyData()
 {
     Mattraffic::deleteAll();
     Material::deleteAll();
     Employee::deleteAll();
     Matvid::deleteAll();
     Izmer::deleteAll();
     Schetuchet::deleteAll();
     Authuser::deleteAll('auth_user_id <> 1');
     Build::deleteAll();
     Dolzh::deleteAll();
     Podraz::deleteAll();
 }
コード例 #4
0
ファイル: Importmaterial.php プロジェクト: vovancho/yii2test
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdmatvid()
 {
     return $this->hasOne(Matvid::className(), ['matvid_id' => 'id_matvid'])->from(['idmatvid' => Matvid::tableName()]);
 }
コード例 #5
0
ファイル: SpravGrupaCest.php プロジェクト: vovancho/yii2test
 /**
  * @depends loadData
  */
 public function destroyData()
 {
     Grupavid::deleteAll();
     Grupa::deleteAll();
     Matvid::deleteAll();
 }