/** * Creates a form model given a token. * * @param string $token * @param array $config name-value pairs that will be used to initialize the object properties * @throws \yii\base\InvalidParamException if token is empty or not valid */ public function __construct($id, $config = []) { $this->_user = Admin::findIdentity($id); if (!$this->_user) { throw new InvalidParamException('Unable to find admin!'); } $this->id = $this->_user->id; parent::__construct($config); }