$targetClass for modal understanding

Hi when I install the advanced app for yii2 and take a look in the signup Model I see this:


['username', 'unique', 'targetClass' => '\common\models\User', 'message' => 'This username has already been taken.'],

I tried to understand the part targetClass with the documentation but struggled. Can anybody explain me how targetClass validates with ‘\common\models\User’. Does it hook with ‘username’ in:


    public static function findByUsername($username)

    {

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

    }

I am having same struggle. Please explain to us. Thank you.