-
Notifications
You must be signed in to change notification settings - Fork 3
/
LoginForm.php
30 lines (26 loc) · 1 KB
/
LoginForm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
namespace infoweb\user\models;
use yii\base\Model;
use dektrium\user\models\LoginForm as BaseLoginForm;
use infoweb\user\Finder;
class LoginForm extends BaseLoginForm
{
/**
* @param Finder $finder
* @param array $config
*/
public function __construct(Finder $finder, $config = [])
{
// Override the singleton instance for the Finder that is set in
// the DI container of the Boostrap class of this module so that our custom Finder is used
\Yii::$container->setSingleton(Finder::className(), [
'userQuery' => \Yii::$container->get('UserQuery'),
'profileQuery' => \Yii::$container->get('ProfileQuery'),
'tokenQuery' => \Yii::$container->get('TokenQuery'),
'accountQuery' => \Yii::$container->get('AccountQuery'),
]);
$this->finder = \Yii::$container->get(Finder::className());
$this->module = \Yii::$app->getModule('user');
Model::__construct($config);
}
}