Reputation: 815
class User extends ActiveRecord\Model
{
pubic static $primary_key = 'userId';
private function isUserLoggedIn() {}
}
The error I get:
A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: lib/Model.php
Line Number: 830
Upvotes: 0
Views: 207
Reputation: 1285
This is caused due to absence of auto-increment field in your table. Please add auto-increment field.
I had faced the same issue.
Upvotes: 0
Reputation: 36
This is a few months late, but I'm just getting into php-activerecord myself.
Your problem might be that you typed "pubic" instead of "public", and php by default doesn't support any pubic variables.
Upvotes: 2
Reputation: 17598
Your problem is going to be in your Users model. It's possible you didn't extend CI_Model, you didn't call parent::construct() in the users constructor, or there is some other error in there.
Upvotes: 0