本文整理匯總了PHP中Invitation::printer_dictionary方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invitation::printer_dictionary方法的具體用法?PHP Invitation::printer_dictionary怎麽用?PHP Invitation::printer_dictionary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Invitation
的用法示例。
在下文中一共展示了Invitation::printer_dictionary方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show
public static function show(Inputter $inputter, JSONOutputter $outputter)
{
// Show
//
$id = $inputter->additional_uri_arguments[0];
$error = null;
UniversallyUniqueIdentifier::propertyIsValid('rawIdentifier', $id, $error);
if (isset($error)) {
$outputter->print_error($error);
}
// User ID
//
$client = new Everyman\Neo4j\Client('events.sb04.stations.graphenedb.com', 24789);
$client->getTransport()->setAuth('Events', '3TP9LHROhv8LIcGmbYzq');
$query_string = 'MATCH (object:Invitation)
WHERE object.' . UNIVERSALLY_UNIQUE_OBJECT_KEY_IDENTIFICATION . ' = \'' . $id . '\'
RETURN object';
$query = new Everyman\Neo4j\Cypher\Query($client, $query_string);
$result = $query->getResultSet();
if (count($result) > 0) {
// Compare sent data is equal to data retrieved
//
$object = $result[0]['object'];
// Print data
//
$outputter->print_data(array(Invitation::printer_dictionary($object)));
} else {
// Throw error, user doesn't exists
//
$error = Error::withDomain(PRIVATE_EVENTS_REST_CONTROLLER_ERROR_DOMAIN, PRIVATE_EVENTS_REST_CONTROLLER_ERROR_CODE_ENTITY_DOES_NOT_EXIST, 'Invitation with ID does not exist.');
$outputter->print_error($error);
}
}