Skip to content
fkmhrk edited this page Sep 25, 2013 · 1 revision

BucketAPI

Get BucketAPI instance

require_once ('<library_root>'. '/src/kii/KiiAppAPI.php');

$context = new KiiContext(APP_ID, APP_KEY, SITE);
$appPpi = new KiiAppAPI($context);
$api = $appApi->bucketAPI();

Query

Please see [How to build KiiCondition]

$bucket = new KiiBucket($user, 'post');
$condition = new KiiCondition(KiiClause::all());
$condition->setLimit(1);
try {
	do {
		$result = $api->query($bucket, $condition);
	} while ($condition->hasNext());
} catch (CloudException $e) {
	// //error handling
}
Clone this wiki locally