common\models\user and in a method called identity with a variable of "Username" but here I am confused, in the user.php file there is only this that refers to the word "Identity"
public static function findIdentity($id)
{
return static::findOne(['id' => $id, 'status' => self::STATUS_ACTIVE]);
}
There is absolutely nothing in that file that refers to the function "Identity", could someone explain this to me please? I cannot work out how yii2 can points to a single variable or function this way.
Also, if a class implements another class all that means is that the class has to have ALL of the functions the other class has.
i.e.
class Users must have every function that Identity has or it is not a valid class. It’s a way for programmers to make sure other programmers are using all required functions for a class. Think of is as making a filed required on a form for a user. Same concept but for programmers writing classes.
So if you remove implements IdentityInterface your user class will still work but you could break other things if you remove any of those functions.