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