Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = UserAccounts::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'creator' => $this->creator, 'creator_ip' => $this->creator_ip, 'confirmed_at' => $this->confirmed_at, 'administrator' => $this->administrator, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at]);
     $query->andFilterWhere(['like', 'login', $this->login]);
     return $dataProvider;
 }
Esempio n. 2
0
 /**
  * 
  * @param string $token
  * @return UserAccounts
  */
 public static function findIdentityByRecoveryToken($token)
 {
     return UserAccounts::findOne(['recovery_token' => $token]);
 }