public function populate() { $password = \Yii::$app->security->generateRandomString(6); $this->generateUsername(); $this->setPassword($password); $this->generateAuthKey(); return $this; }