当前位置: 首页>>代码示例>>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;未经允许,请勿转载。