本文整理汇总了PHP中Statement::setBatchSize方法的典型用法代码示例。如果您正苦于以下问题:PHP Statement::setBatchSize方法的具体用法?PHP Statement::setBatchSize怎么用?PHP Statement::setBatchSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statement
的用法示例。
在下文中一共展示了Statement::setBatchSize方法的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();
}