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


PHP Statement::setCount方法代碼示例

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


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

示例1: getCommonProperties

 /**
  * Get vertices with common properties.
  *
  * This will throw if the list cannot be fetched from the server
  *
  * This method accepts multiple argument types for the <b>vertex examples</b>, these can be:
  * <li>a vertex id </li>
  * <li><b>null</b> select every vertex</li>
  * <li>an array containing key value pairs that must match a vertex</li>
  * <li>an array of arrays containing key value pairs that must match a vertex. 
  * This example means that you can define filters and combine them with "or".</li><br><br>
  *
  * @throws Exception
  *
  * @param mixed      $graph        - graph name as a string or instance of Graph
  * @param mixed      $vertex1Example     - see 'getNeighborVertices'
  * @param mixed      $vertex2Example     - see 'getNeighborVertices'
  * @param array      $options      - see 'options' description.
  * <ul><br>
  * <li><b>vertex1CollectionRestriction</b> - One or multiple vertex collection names.
  * Only vertices from these collections will be considered.
  * <li><b>vertex2CollectionRestriction</b> - One or multiple vertex collection names.
  * Only vertices from these collections will be considered.
  * <li><b>ignoreProperties</b> - One or multiple attributes of a document that should be ignored, either a string or an array.
  * </li>
  * </ul>
  *
  * @return Cursor
  */
 public function getCommonProperties($graph, $vertex1Example = null, $vertex2Example = null, $options = array())
 {
     if ($graph instanceof Graph) {
         $graph = $graph->getKey();
     }
     $statement = new Statement($this->getConnection(), array("query" => ''));
     $statement->setResultType('commonProperties');
     $aql = "FOR a IN GRAPH_COMMON_PROPERTIES(@graphName, @vertex1, @vertex2, @options) ";
     $statement->bind('graphName', $graph);
     $statement->bind('vertex1', $vertex1Example);
     $statement->bind('vertex2', $vertex2Example);
     $statement->bind('options', $options);
     if (isset($this->batchsize)) {
         $statement->setBatchSize($this->batchsize);
         unset($this->batchsize);
     }
     if (isset($this->count)) {
         $statement->setCount($this->count);
         unset($this->count);
     }
     if (isset($this->limit)) {
         $aql .= " LIMIT " . $this->limit;
         unset($this->limit);
     }
     $aql .= " RETURN a";
     $statement->setQuery($aql);
     return $statement->execute();
 }
開發者ID:TomSearch,項目名稱:arangodb-php-docs,代碼行數:57,代碼來源:GraphHandler.php


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