Esempio n. 1
0
 public function search($params)
 {
     $query = UserRole::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }
Esempio n. 2
0
 public function getUserRole()
 {
     return $this->hasOne(UserRole::className(), ['id' => 'role']);
 }