// Return a formatted user name and email $user = new TUser(1); echo $user->returnFormattedName() . "<br />"; echo $user->email. unset($user); // Add a new user $user = new TUser(); $user->username = 'testuser'; $user->email = 'some@email.com'; unset($user);
Framewerk TUser
Posted on September 28, 2005
&tLast night I added what I think is one of the cooler features in Framewerk last night. The TUser object when initialized with an id or username in the constructor loads the user data as attributes of the object. If you change them, it will automatically save them when it's destroyed. If you initialize by passing nothing to the constructor, it creates a new user. If you update the attributes, it changes them, if you don't, it just removes all reference to the new user. It makes for very easy interaction for dealing with user data.
