The function df_get_record_by_id() returns a Dataface_Record object. And the Dataface_Record object contains a method getId() that returns the ID. This allows you to easily and universally pass a record between requests.
E.g.
// Load the record with id 10 from the people table
$record = df_get_record('people', array('id'=>10));
// Get the unique id of this record.
$recordid = $record->getId();
// Let's just print the id to see what it looks like
echo $recordid;
// Should be something like: people?id=10
// Now load the record again but this time using its universal id
$record2 = df_get_record_by_id($recordid);
No comments:
Post a Comment