$Obj->set()
// $Obj->set($field,$value);
$person->set('nick','Chester');
$content->set('headline','Hello World!');
$group->set('groupname','Fish Lovers');
$comment->set('comment','Shut up!');
$file->set('file_name','img');
Set the value of $field to $value.
You may set values for native fields - those that exist in the pre-defined list of fields present in the database schema - or for meta fields which can be created at any time.
// set a real field
$doc->set('headline','This is a test');
// set a meta field
$doc->set('clown_nose','red');
You may specify that a value is NOT saved to the database by passing in an optional third parameter. Otherwise, values will be saved to the database upon calling the save() function.
// set a temporary field on a $person object
if ($person->get('id') == $POD->currentUser()->get('id')) {
$person->set('isCurrentUser','1',false);
}
As of version 0.7, you no longer have to use the set method for basic content changes. You may now reference the field as if it was a native object attribute:
// set real fields $content->headline = 'this is my headline'; $person->nick = 'chester'; $group->description = 'a group for cool kids'; // set meta fields $content->endDate = '2012-12-31'; $person->aboutme = 'this is my bio';
Download the latest version of PeoplePods!
0.9
Latest Version:
Release Notes
Recent Posts from Our Blog
Version 0.9 is here!
The latest version of PeoplePods is now available for download! This version features a drastically revamped theme which is now valid HTML5, a completely rewritten JSON-powered API, many...
Ben Brown on how running a community is like throwing a giant, never-ending party
An interview I did with OpenSource.com is now online! Read it here. In it, I discuss how running an online community is like throwing a giant, never-ending party, how open source techniques...
Recently Updated Documentation
Recent Posts from The Forum
I am trying to find a way of integrating a forum, much like this one, into my site. Any help?
0 comments | 3 days ago
Hello PeoplePods forum, we want to add social networking features to our online training software. We are looking to allow users to post comments on...
0 comments | 6 weeks ago
Hello, My firt problem is whith the API, because when I open my site I find : Invalid API Key. Please visit PeoplePods.net to get a valid...
2 comments | 6 weeks ago


Note to others (and myself): A temporary field comes in handy when one needs to display additional information in the output (through the themes), but the info shouldn't be saved into the object. e.g. $person->set('loginType','twitter',false); $person->output('login.oauth.php'); // login.oauth.php will display different info based on the loginType