require_once 'DataObject.php'; class User extends DataObject { protected $data = array( 'id' => null, 'name' => '', 'email' => '' ); } $user = new User(); $user->name = 'John Doe'; $user->email = 'john.doe@example.com'; $user->insert();
$user = User::getById(1); $user->name = 'Jane Doe'; $user->update();
$user = User::getById(1); $user->delete();
pear install -o PEAR.php.net/NET_DataObject