Home » Documentation » What is PeoplePods? » SDK Documentation » Object Definitions » $Obj

$Obj

The Obj class is the base class for Person Objects, Content Objects, Group Objects, Comment Objects and File Objects. It provides all the basic functionality like setting values, getting values, and writing values out for display.

Thanks to the magic of object inheritance, all of the objects have access to these functions. We've defined $Obj->write(), so it exists for every type of object!

$person->write('nick');
$content->write('headline');
$group->write('groupname');
$comment->write('comment');
$file->write('thumbnail');

The Obj class also implements the meta field and flagging functionality for people, content and groups. This functionality works the same everywhere:

// add an about_me field to $person
$person->addMeta('about_me','I am awesome');

// add an endDate to $content
$content->addMeta('endDate','2012-12-31');

// add a motto to $group
$group->addMeta('motto','Stay Hoopy');

// flag $person as a friend of the current user
$person->addFlag('friend',$POD->currentUser());

// flag $content as a favorite of the current user
$content->addFlag('favorite',$POD->currentUser());

// flag $group with a warn flag
$content->addFlag('warn',$POD->currentUser());

You should never directly instantiate one of these! They don't do anything on their own. But paired with the subclasses, these puppies do all the heavy lifting. All of the SQL queries responsible for loading things from the database are located in this class. Obj knows how different objects relate to one another and can build the necessary links.

More about this function and it's related functions:

  • Discuss This Document

No comments have been posted yet.

Download Download the latest version of PeoplePods!

0.667 Latest Version:
Release Notes

A free membership is required to download PeoplePods.

  Already Registered? Login

Recent Posts from Our Blog

Developer Preview Launch!

I am very excited to announce the launch of PeoplePods version 0.666, THE DEVELOPER PREVIEW! After tons of hacking, I have tweaked the last line of code, and I am finally ready for a wider audience...