コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Transporte::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(['idTransporte' => $this->idTransporte, 'Peso' => $this->Peso, 'TIpoTransporte_idTIpoTransporte' => $this->TIpoTransporte_idTIpoTransporte, 'RRHH_idRRHH' => $this->RRHH_idRRHH, 'tiporrhh_idTipoRRHH' => $this->tiporrhh_idTipoRRHH]);
     $query->andFilterWhere(['like', 'Matricula', $this->Matricula]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransporteIdTransporte()
 {
     return $this->hasOne(Transporte::className(), ['idTransporte' => 'Transporte_idTransporte', 'TIpoTransporte_idTIpoTransporte' => 'Transporte_TIpoTransporte_idTIpoTransporte', 'RRHH_idRRHH' => 'Transporte_RRHH_idRRHH', 'tiporrhh_idTipoRRHH' => 'Transporte_tiporrhh_idTipoRRHH']);
 }
コード例 #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransportes()
 {
     return $this->hasMany(Transporte::className(), ['tiporrhh_idTipoRRHH' => 'idTipoRRHH']);
 }
コード例 #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransportes()
 {
     return $this->hasMany(Transporte::className(), ['loadlimit' => 'id']);
 }
コード例 #5
0
 /**
  * Finds the Transporte model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $idTransporte
  * @param integer $TIpoTransporte_idTIpoTransporte
  * @param integer $RRHH_idRRHH
  * @param integer $tiporrhh_idTipoRRHH
  * @return Transporte the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($idTransporte, $TIpoTransporte_idTIpoTransporte, $RRHH_idRRHH, $tiporrhh_idTipoRRHH)
 {
     if (($model = Transporte::findOne(['idTransporte' => $idTransporte, 'TIpoTransporte_idTIpoTransporte' => $TIpoTransporte_idTIpoTransporte, 'RRHH_idRRHH' => $RRHH_idRRHH, 'tiporrhh_idTipoRRHH' => $tiporrhh_idTipoRRHH])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }