-
Notifications
You must be signed in to change notification settings - Fork 2
ObjectAPI
fkmhrk edited this page Sep 12, 2013
·
4 revisions
require_once ('<library_root>'. '/src/kii/KiiAppAPI.php');
$context = new KiiContext(APP_ID, APP_KEY, SITE);
$appPpi = new KiiAppAPI($context);
$api = $appApi->objectAPI();
$bucket = new KiiBucket($user, 'post');
$data = array(
'name' => 'fkm'
);
try {
$obj = $api->create($bucket, $data);
} catch (CloudException $e) {
//error handling
}
$obj->data['score'] = 120;
try {
$obj = $api->update($obj);
} catch (CloudException $e) {
//error handling
}
$obj is KiiObject.
try {
$api->delete($obj);
} catch (CloudException $e) {
//error handling
}
$obj is KiiObject.