当前位置: 首页>>代码示例>>PHP>>正文


PHP Factory::getObject方法代码示例

本文整理汇总了PHP中Factory::getObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getObject方法的具体用法?PHP Factory::getObject怎么用?PHP Factory::getObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Factory的用法示例。


在下文中一共展示了Factory::getObject方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getDirectionalVertices

 public function getDirectionalVertices($direction)
 {
     $direction = rtrim(strtolower($direction), 'e');
     $directions = array('in', 'out', 'both');
     if (!in_array($direction, $directions)) {
         throw new \InvalidArgumentException("Invalid direction {$direction}");
     }
     if (empty($this->id)) {
         throw new \InvalidArgumentException("Invalid vertex id");
     }
     $url = $this->getPath() . '/' . $this->getId() . "/{$direction}";
     $response = $this->graph->makeRequest('GET', $url);
     return Factory::getObject($this->getClient(), $response);
 }
开发者ID:atomicjets,项目名称:PHP-Rexster,代码行数:14,代码来源:Vertex.php

示例2: getEdge

 public function getEdge($edge_id)
 {
     if (empty($edge_id)) {
         throw new \InvalidArgumentException("Invalid edge id");
     }
     $response = $this->makeRequest('GET', "/edges/{$edge_id}");
     return Factory::getObject($this, $response);
 }
开发者ID:atomicjets,项目名称:PHP-Rexster,代码行数:8,代码来源:Graph.php

示例3: setFriend

 public function setFriend($name)
 {
     $this->friend = Factory::getObject($name);
 }
开发者ID:ryantxr,项目名称:php-slices,代码行数:4,代码来源:lazy_loading_facade.php

示例4: update

 /**
  * Update an item in the graph
  * 
  * @param string $method - PUT OR POST
  * @throws Rexster_Exception
  * @return requested object type
  */
 public function update($method = 'POST')
 {
     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}");
     }
     $data = $this->toArray();
     if (empty($data)) {
         throw new \InvalidArgumentException("Invalid properies to update - Properties array should be an associative array of property => value");
     }
     $reserved = array('id', '_id');
     foreach ($reserved as $key) {
         if (isset($data[$key])) {
             unset($data[$key]);
         }
     }
     $url = '/' . $this->getPath() . '/' . $this->getId();
     $response = $this->getClient()->makeRequest($method, $url, $data);
     return Factory::getObject($this->getClient(), $response);
 }
开发者ID:atomicjets,项目名称:PHP-Rexster,代码行数:29,代码来源:Object.php


注:本文中的Factory::getObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。