Exemplo n.º 1
0
 public function actionAtributos($pasoId)
 {
     $model = new Atributos();
     $model->pasoId = $pasoId;
     $atributos = Atributos::find()->where('pasoId = :pasoId', ['pasoId' => $pasoId])->all();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $id = $model->tipoTramiteId;
         $model = new Atributos();
         return $this->redirect(['atributos', 'model' => $model, 'atributos' => $atributos, 'pasoId' => $pasoId, 'id' => $id]);
     } else {
         return $this->render('atributos', ['model' => $model, 'atributos' => $atributos]);
     }
 }
Exemplo n.º 2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAtributos()
 {
     return $this->hasMany(Atributos::className(), ['tipoAtributoId' => 'id']);
 }
Exemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getAtributo()
 {
     return $this->hasOne(Atributos::className(), ['id' => 'atributoId']);
 }
Exemplo n.º 4
0
 /**
  * Finds the Empleado model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Empleado the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Atributos::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Exemplo n.º 5
0
 public function retriveAttr($attrid, $paso)
 {
     if (!$this->permisosPorPaso[$paso][USUARIOS::$LEER] && !$this->__salvando) {
         throw new ForbiddenHttpException('Informacion Restringida');
     }
     if (!empty($this->_pasos[$paso][$attrid])) {
         return $this->_pasos[$paso][$attrid];
     }
     $atributo = Atributos::find()->where(['id' => $attrid, 'tipoTramiteId' => $this->tipoDeTramite()])->one();
     if (empty($atributo)) {
         throw new UnknownPropertyException('Setting unknown property: ' . get_class($this) . '::' . $attrid);
     }
     if (!empty($this->id)) {
         $valtemp = ValoresTramite::find()->where(['atributoId' => $atributo->id, 'tramiteId' => $this->id])->one();
         if (!empty($valtemp)) {
             $this->_pasos[$paso][$attrid] = $valtemp;
             return $valtemp;
         }
     }
     $valor = new ValoresTramite();
     $valor->atributoId = $atributo->id;
     $this->_pasos[$paso][$attrid] = $valor;
     return $valor;
 }