Ejemplo n.º 1
0
 /**
  * Finds the MovieLanguage model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return MovieLanguage the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = MovieLanguage::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = MovieLanguage::find()->where('status=0');
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['Id' => $this->Id, 'status' => $this->status, 'createdOn' => $this->createdOn, 'updatedOn' => $this->updatedOn, 'createdBy' => $this->createdBy, 'updatedBy' => $this->updatedBy]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'languageCode', $this->languageCode])->andFilterWhere(['like', 'ip', $this->ip]);
     return $dataProvider;
 }
Ejemplo n.º 3
0
<div class="movie-search">

    <?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>

    <?php 
echo $form->field($model, 'Id');
?>

    <?php 
echo $form->field($model, 'name');
?>
    <?php 
echo $form->field($model, 'launguageId')->dropDownList(ArrayHelper::merge(['' => 'Select'], ArrayHelper::map(\common\models\MovieLanguage::find()->andWhere(['status' => 1])->All(), 'Id', 'name')));
?>
 
    <?php 
echo $form->field($model, 'state')->dropDownList(ArrayHelper::merge(['' => 'Select'], $model->StateNameArray()), ['id' => 'state']);
?>
    <?php 
// $form->field($model, 'cast')
?>

    <?php 
// $form->field($model, 'synopsis')
?>

    <?php 
//$form->field($model, 'launguageId')
Ejemplo n.º 4
0
 public function getLanguage()
 {
     return $this->hasOne(MovieLanguage::className(), ['Id' => 'launguageId']);
 }