當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。