I have a class User. Then I extend User with some extra information in Profile.
My constructor for Profile looks like this:
function __construct($user_id) {
// This function sets all of User's attributes
$this->set_user_data($user_id);
// This function sets the extra attribute for Profile.
$this->set_follow_status();
}
The second function uses $this->user_id, an attribute set in the first function. I get this error from the second function: Fatal error: Using $this when not in object context.
Am I forgetting something about extending objects in PHP?