I am trying to create a user model (non-ORM) that I can simply reference throughout the app (i.e. \User::currentUser) to get various details about the user after logged in. Please see attached model. No matter what I try, I can not access the variable I have set from my process_login function (I tried imitating functionality from the SimpleAuth login class). I keep getting [30-Apr-2013 21:19:36 America/New_York] PHP Fatal error: Using $this when not in object context in /home/poochfin/public_html/fuel/app/classes/model/user.php on line 144. Also, if setup this way, will I be able to access the singular User instance (and the current logged in user) throughout the app? Thanks
$user is defined as an object property (not static), but you're not in an object context when you call something statically. Which is why you get the error, there is no object, therefore there is no $this.