本文整理匯總了PHP中Factory::getGeneric方法的典型用法代碼示例。如果您正苦於以下問題:PHP Factory::getGeneric方法的具體用法?PHP Factory::getGeneric怎麽用?PHP Factory::getGeneric使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Factory
的用法示例。
在下文中一共展示了Factory::getGeneric方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInfo
/**
* Get info for the current graph
*
* @return array
*/
public function getInfo()
{
$response = $this->makeRequest('GET');
return Factory::getGeneric($this, $response);
}
示例2: putCustom
/**
* Performs a PUT request to a custom endpoint with payload $data
*
* @param string $url
* @param array $data
* @throws \InvalidArgumentException
* @throws \RuntimeException
* @return Ambigous <boolean, \Rexster\Object>
*/
public function putCustom($url, array $data = array())
{
if (empty($url)) {
throw new \InvalidArgumentException('Invalid URL');
}
$response = $this->makeRequest('PUT', "/{$url}", $data);
if (!$response) {
throw new \RuntimeException($this->getLastErrorMessage());
}
return Factory::getGeneric($this, $response);
}
示例3: getBothDirectionVertexIds
public function getBothDirectionVertexIds()
{
if (empty($this->id)) {
throw new \InvalidArgumentException("Invalid vertex id");
}
$response = $this->getClient()->makeRequest('GET', $this->getPath() . '/' . $this->getId() . '/bothIds');
return Factory::getGeneric($this->getClient(), $response);
}
示例4: delete
public function delete(array $properties = array())
{
if (empty($this->id)) {
throw new \InvalidArgumentException('Invalid object id to update');
}
if ($this->id != $this->_id) {
throw new \InvalidArgumentException("Node ID's do not match? this->_id = {$this->_id} -- this->id = {$this->id}");
}
$url = '/' . $this->getPath() . '/' . $this->getId();
if (!empty($properties)) {
$tmp = array();
foreach ($properties as $property) {
$tmp[$property] = $property;
}
unset($properties);
$properties = $tmp;
}
$response = $this->getClient()->makeRequest("DELETE", $url, $properties);
return Factory::getGeneric($this->getClient(), $response);
}