未定义属性“ UserIdentity._id”

阿伦索尔

一直说未定义属性,下面将如何定义代码和堆栈跟踪。我正在为此项目使用Yii框架。堆栈跟踪显示我也收到了正确的用户ID。

$users= Users::model()->findByAttributes(array('Email'=>$this->Email));
        
        if($users===null) {
            $this->errorCode = self::ERROR_USERNAME_INVALID; 
            echo 'failed here1';
        }
        else if(!$users->validatePassword($this->Password)) {
            $this->errorCode = self::ERROR_PASSWORD_INVALID;
            echo 'failed here 2';
        }
        else {           
            $this->errorCode = self::ERROR_NONE;
            $this->_id = $users->UserID; //this is the error line
        }
        return !$this->errorCode;
    }
    
    public function getId() {
        return $this->_id;
    }

}

堆栈跟踪

0

  • C:\ xampp \ htdocs \ barbadosv2 \ protected \ components \ UserIdentity.php(48):CComponent-> __ set(“ _ id”,“ 51”)
贾普穆尔

您必须_id在UserIdentity类中定义属性。(因此在任何功能之外)

class UserIdentity extends CUserIdentity {
    private $_id;

     // .. any functions etc.
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

id属性返回null或未定义

来自分类Dev

无法读取未定义的属性“ id”

来自分类Dev

id属性返回null或未定义

来自分类Dev

Microsoft.AspNet.Identity.EntityFramework-UserIdentity和RoleIdenity ID字段

来自分类Dev

骨干给出未定义的自定义ID属性

来自分类Dev

灰烬路线:无法读取未定义的属性“ id”

来自分类Dev

错误:无法在UserComponent上设置未定义的属性“ id”

来自分类Dev

Laravel Eloquent HasOne :: $ id未定义属性

来自分类Dev

dojo无法设置未定义的属性“ id”

来自分类Dev

angularjs添加值无法设置未定义的属性“ id”

来自分类Dev

guildBanAdd无法读取未定义的属性“ id”

来自分类Dev

快速会话无法设置未定义的属性“ id”

来自分类Dev

UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“ id”

来自分类Dev

Gatsby TypeError-无法读取未定义的属性“ id”

来自分类Dev

MERN-TypeError:无法读取未定义的属性“ id”

来自分类Dev

删除时出错:无法读取未定义的属性“ id”

来自分类Dev

Serverless:“ errorMessage”:“无法读取未定义的属性” id“,

来自分类Dev

Angular Material TypeError:无法读取未定义的属性“ id”

来自分类Dev

用户注销后无法读取未定义的属性“ _id”

来自分类Dev

错误:无法在UserComponent上设置未定义的属性“ id”

来自分类Dev

UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“ id”

来自分类Dev

guildBanAdd无法读取未定义的属性“ id”

来自分类Dev

无法读取未定义的属性“ id”。表示

来自分类Dev

dojo无法设置未定义的属性“ id”

来自分类Dev

快速会话无法设置未定义的属性“ id”

来自分类Dev

Laravel未定义属性:stdClass :: $ id错误

来自分类Dev

JWT-TypeError:无法读取未定义的属性“id”

来自分类Dev

$('#id')。value未定义

来自分类Dev

用户ID未定义

Related 相关文章

  1. 1

    id属性返回null或未定义

  2. 2

    无法读取未定义的属性“ id”

  3. 3

    id属性返回null或未定义

  4. 4

    Microsoft.AspNet.Identity.EntityFramework-UserIdentity和RoleIdenity ID字段

  5. 5

    骨干给出未定义的自定义ID属性

  6. 6

    灰烬路线:无法读取未定义的属性“ id”

  7. 7

    错误:无法在UserComponent上设置未定义的属性“ id”

  8. 8

    Laravel Eloquent HasOne :: $ id未定义属性

  9. 9

    dojo无法设置未定义的属性“ id”

  10. 10

    angularjs添加值无法设置未定义的属性“ id”

  11. 11

    guildBanAdd无法读取未定义的属性“ id”

  12. 12

    快速会话无法设置未定义的属性“ id”

  13. 13

    UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“ id”

  14. 14

    Gatsby TypeError-无法读取未定义的属性“ id”

  15. 15

    MERN-TypeError:无法读取未定义的属性“ id”

  16. 16

    删除时出错:无法读取未定义的属性“ id”

  17. 17

    Serverless:“ errorMessage”:“无法读取未定义的属性” id“,

  18. 18

    Angular Material TypeError:无法读取未定义的属性“ id”

  19. 19

    用户注销后无法读取未定义的属性“ _id”

  20. 20

    错误:无法在UserComponent上设置未定义的属性“ id”

  21. 21

    UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“ id”

  22. 22

    guildBanAdd无法读取未定义的属性“ id”

  23. 23

    无法读取未定义的属性“ id”。表示

  24. 24

    dojo无法设置未定义的属性“ id”

  25. 25

    快速会话无法设置未定义的属性“ id”

  26. 26

    Laravel未定义属性:stdClass :: $ id错误

  27. 27

    JWT-TypeError:无法读取未定义的属性“id”

  28. 28

    $('#id')。value未定义

  29. 29

    用户ID未定义

热门标签

归档