예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Exploracao::find();
     $query->joinWith('relIdDono');
     // add conditions that should always apply here
     $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;
     }
     // grid filtering conditions
     //$query->andFilterWhere([
     //    'idDono' => $this->idDono,
     //]);
     $query->andFilterWhere(['like', 'marca', $this->marca])->andFilterWhere(['like', 'Exploracao.nome', $this->nome])->andFilterWhere(['like', 'Pessoa.nome', $this->idDono]);
     return $dataProvider;
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getRelIdExploracao()
 {
     return $this->hasOne(Exploracao::className(), ['marca' => 'idExploracao']);
 }
예제 #3
0
파일: _form.php 프로젝트: AnaSousa25/TcV
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'nome')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'parcelario')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'local')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'marcaExploracao')->dropDownList(ArrayHelper::map(Exploracao::find()->all(), 'marca', 'nome'), ['prompt' => 'Escolher Exploração']);
?>
    
    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Criar' : 'Atualizar', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php 
ActiveForm::end();
?>

</div>
예제 #4
0
 /**
  * Finds the Exploracao model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Exploracao the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Exploracao::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
예제 #5
0
파일: Nucleo.php 프로젝트: AnaSousa25/TcV
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getMarcaExploracao0()
 {
     return $this->hasOne(Exploracao::className(), ['marca' => 'marcaExploracao']);
 }
예제 #6
0
파일: Pessoa.php 프로젝트: AnaSousa25/TcV
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getExploracaos()
 {
     return $this->hasMany(Exploracao::className(), ['idDono' => 'idPessoa']);
 }