public static function first($user = null)
    {
        if (!User::isValid($user)) {
            throw new InvalidParamException('User Invalid.');
        }
        return static::find()->createdBy($user)->orderByCreatedAt()->one();
    }
public static function first($user = null)
    {
        if (!User::isValid($user)) {
            throw new InvalidParamException('User Invalid.');
        }
        return static::find()->createdBy($user)->orderByCreatedAt()->one();
    }
public static function first ( $ user = null ) { if ( ! User :: isValid ( $ user ) ) { throw new InvalidParamException ( 'User Invalid.' ) ; } return static :: find ( ) -> createdBy ( $ user ) -> orderByCreatedAt ( ) -> one ( ) ; }
Get first password hash.

@param User $user
@return static
@throws InvalidParamException throw if user invalid.
Get first password hash .