User Model In Yii2

Hello

I added prefix to all tables "tbl_" and all models are named like "TblAbc".

All things was good, until i run composer update.

My main problem is this:

In User model, i changed "findByUsername" function to "findByEmail" and when i remove "status" from code below, application gives error:

[color="#FF0000"]PHP Fatal Error – yii\base\ErrorException

Class ‘yii\helpers\Security’ not found[/color]

Default code:




    public static function findByEmail($email)

    {

        return static::findOne(['email' => $email, 'status' => self::STATUS_ACTIVE]);

    }



Status removed:




    public static function findByEmail($email)

    {

        return static::findOne(['email' => $email]);

    }




Please help me to resolve that, and describe about User model.

What structure exactly must User table have ?

Is there user table schema ?

Sorry for my bad english.

Thanks

In default code, when i submit email & pass to login, previous error was occured too.

Thanks for your reply.

I add code below to my component in "common\config\main.php"




        'security' => [

            'cryptBlockSize' => 16,

            'cryptKeySize' => 24,

            'derivationIterations' => 1000,

        ],



But not resolved!

What changes must i do ?

You must use Security as component in User model, not a helper

https://github.com/yiisoft/yii2/blob/master/apps/advanced/common/models/User.php#L144

Thanks so much :D

Resolved