/** * 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(); }