當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Node::inflateFromResponse方法代碼示例

本文整理匯總了PHP中Node::inflateFromResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP Node::inflateFromResponse方法的具體用法?PHP Node::inflateFromResponse怎麽用?PHP Node::inflateFromResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Node的用法示例。


在下文中一共展示了Node::inflateFromResponse方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getNodeById

 public function getNodeById($node_id)
 {
     $uri = $this->base_uri . 'node/' . $node_id;
     list($response, $http_code) = HTTPUtil::jsonGetRequest($uri);
     switch ($http_code) {
         case 200:
             return Node::inflateFromResponse($this, $response);
         case 404:
             throw new NotFoundException();
         default:
             throw new HttpException($http_code);
     }
 }
開發者ID:nightchiller,項目名稱:Neo4J-REST-PHP-API-client,代碼行數:13,代碼來源:php-neo-rest.php

示例2: performPluginCommand

 public function performPluginCommand($plugin, $command, $data, $inflate_nodes = true)
 {
     $uri = $this->base_uri . 'ext/' . $plugin . 'Plugin/graphdb/' . $command;
     list($response, $http_code) = HTTPUtil::jsonPostRequest($uri, $data);
     if ($inflate_nodes && $http_code == 200) {
         // Process results to replace node object with actualy node objects
         for ($i = 0; $i < count($response['data']); $i++) {
             for ($j = 0; $j < count($response['data'][$i]); $j++) {
                 if (is_array($response['data'][$i][$j]) && isset($response['data'][$i][$j]['data'])) {
                     $response['data'][$i][$j] = Node::inflateFromResponse($this, $response['data'][$i][$j]);
                 }
             }
         }
     }
     switch ($http_code) {
         case 200:
             return $response;
         case 404:
             throw new NotFoundException();
         default:
             throw new HttpException($http_code);
     }
 }
開發者ID:electric-al,項目名稱:Neo4J-REST-PHP-API-client,代碼行數:23,代碼來源:php-neo-rest.php

示例3: getNodeByUri

 /**
  * get the node by uri
  *
  * @throws \Neo4j\Exception\HttpException
  * @throws \Neo4j\Exception\NotFoundException
  * @param string $uri The Request URI
  * @return Neo4j\Node
  */
 public function getNodeByUri($uri)
 {
     list($response, $http_code) = Request::get($uri);
     if ($http_code == 404) {
         throw new \Neo4j\Exception\NotFoundException();
     }
     if ($http_code != 200) {
         throw new \Neo4j\Exception\HttpException("http code: " . $http_code . ", response: " . print_r($response, true));
     }
     return Node::inflateFromResponse($this, $response);
 }
開發者ID:nightchiller,項目名稱:pneo4j,代碼行數:19,代碼來源:Database.php

示例4: getNodes

 /**
  * get nodex by key value pair
  *
  * @throws \Neo4j\Exception\HttpException
  * @throws \Neo4j\Exception\NotFoundException
  *
  * @param string $key
  * @param string $value
  *
  * @return array
  */
 public function getNodes($key, $value)
 {
     $nodes = array();
     $this->_uri = $this->_db->getBaseUri() . 'index/node/' . $key . '/' . $value;
     list($response, $http_code) = Request::get($this->_uri);
     if ($http_code != 200) {
         throw new \Neo4j\Exception\HttpException("http code: " . $http_code . ", response: " . print_r($response, true));
     }
     foreach ($response as $nodeData) {
         $nodes[] = Node::inflateFromResponse($this->_db, $nodeData);
     }
     if (empty($nodes)) {
         throw new \Neo4j\Exception\NotFoundException();
     }
     return $nodes;
 }
開發者ID:nightchiller,項目名稱:pneo4j,代碼行數:27,代碼來源:Index.php


注:本文中的Node::inflateFromResponse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。