/** * @return \yii\db\ActiveQuery */ public function getValoresTramites() { return $this->hasMany(ValoresTramite::className(), ['tramiteId' => 'id']); }
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; }