Location: PHPKode > projects > ArangoDB-PHP > ArangoDB-PHP-1.0.1/docs/classes/triagens.ArangoDb.CollectionHandler.html
<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<meta charset="utf-8">
<title>ArangoDB PHP client API » \triagens\ArangoDb\CollectionHandler</title>
<meta name="author" content="Mike van Riel">
<meta name="description" content="">
<link href="../css/template.css" rel="stylesheet" media="all">
<script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico">
<link rel="apple-touch-icon" href="../img/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner"><div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">ArangoDB PHP client API</a><div class="nav-collapse"><ul class="nav">
<li class="dropdown">
<a href="#api" class="dropdown-toggle" data-toggle="dropdown">
                                    API Documentation <b class="caret"></b></a><ul class="dropdown-menu">
<li><a>Namespaces</a></li>
<li><a href="../namespaces/triagens.html"><i class="icon-th"></i> triagens</a></li>
<li><a>Packages</a></li>
<li><a href="../packages/ArangoDbPhpClient.html"><i class="icon-folder-open"></i> ArangoDbPhpClient</a></li>
</ul>
</li>
<li class="dropdown" id="charts-menu">
<a href="#charts" class="dropdown-toggle" data-toggle="dropdown">
                                    Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul>
</li>
<li class="dropdown" id="reports-menu">
<a href="#reports" class="dropdown-toggle" data-toggle="dropdown">
                                    Reports <b class="caret"></b></a><ul class="dropdown-menu">
<li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors 
                <span class="label label-info">0</span></a></li>
<li><a href="../markers.html"><i class="icon-map-marker"></i> Markers 
                <ul></ul></a></li>
<li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements 
                <span class="label label-info">9</span></a></li>
</ul>
</li>
</ul></div>
</div></div>
<div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div>
</div>
<div id="___" class="container">
<noscript><div class="alert alert-warning">
                            Javascript is disabled; several features are only available
                            if Javascript is enabled.
                        </div></noscript>
<div class="row">
<div class="span4">
<span class="btn-group visibility" data-toggle="buttons-checkbox"><button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button></span><div class="btn-group view pull-right" data-toggle="buttons-radio">
<button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button>
</div>
<ul class="side-nav nav nav-list">
<li class="nav-header">
<i class="icon-custom icon-method"></i> Methods
                    <ul>
<li class="method public inherited"><a href="#method___construct" title="__construct :: Construct a new handler"><span class="description">Construct a new handler</span><pre>__construct()</pre></a></li>
<li class="method public "><a href="#method_add" title="add :: Adds a new collection on the server"><span class="description">Adds a new collection on the server</span><pre>add()</pre></a></li>
<li class="method public "><a href="#method_byExample" title="byExample :: Get document(s) by specifying an example"><span class="description">Get document(s) by specifying an example</span><pre>byExample()</pre></a></li>
<li class="method public "><a href="#method_count" title="count :: Get the number of documents in a collection"><span class="description">Get the number of documents in a collection</span><pre>count()</pre></a></li>
<li class="method public "><a href="#method_create" title="create :: Creates a new collection on the server"><span class="description">Creates a new collection on the server</span><pre>create()</pre></a></li>
<li class="method public "><a href="#method_delete" title="delete :: Delete a collection"><span class="description">Delete a collection</span><pre>delete()</pre></a></li>
<li class="method public "><a href="#method_drop" title="drop :: Drop a collection"><span class="description">Drop a collection</span><pre>drop()</pre></a></li>
<li class="method public "><a href="#method_figures" title="figures :: Get figures for a collection"><span class="description">Get figures for a collection</span><pre>figures()</pre></a></li>
<li class="method public "><a href="#method_get" title="get :: Get information about a collection"><span class="description">Get information about a collection</span><pre>get()</pre></a></li>
<li class="method public "><a href="#method_getAllIds" title="getAllIds :: Get the list of all documents' ids from a collection"><span class="description">Get the list of all documents' ids from a collection</span><pre>getAllIds()</pre></a></li>
<li class="method public "><a href="#method_getCount" title="getCount :: Get the number of documents in a collection"><span class="description">Get the number of documents in a collection</span><pre>getCount()</pre></a></li>
<li class="method public "><a href="#method_getFigures" title="getFigures :: Get figures for a collection"><span class="description">Get figures for a collection</span><pre>getFigures()</pre></a></li>
<li class="method public "><a href="#method_index" title="index :: Creates an index on a collection on the server"><span class="description">Creates an index on a collection on the server</span><pre>index()</pre></a></li>
<li class="method public "><a href="#method_near" title="near :: Get document(s) by specifying near"><span class="description">Get document(s) by specifying near</span><pre>near()</pre></a></li>
<li class="method public "><a href="#method_range" title="range :: Get document(s) by specifying range"><span class="description">Get document(s) by specifying range</span><pre>range()</pre></a></li>
<li class="method public "><a href="#method_rename" title="rename :: Rename a collection"><span class="description">Rename a collection</span><pre>rename()</pre></a></li>
<li class="method public "><a href="#method_truncate" title="truncate :: Truncate a collection"><span class="description">Truncate a collection</span><pre>truncate()</pre></a></li>
<li class="method public "><a href="#method_within" title="within :: Get document(s) by specifying within"><span class="description">Get document(s) by specifying within</span><pre>within()</pre></a></li>
</ul>
</li>
<li class="nav-header protected">» Protected
                    <ul><li class="method protected inherited"><a href="#method_getConnection" title="getConnection :: Return the connection object"><span class="description">Return the connection object</span><pre>getConnection()</pre></a></li></ul>
</li>
<li class="nav-header private">» Private
                    <ul><li class="method private "><a href="#method_getCursorOptions" title="getCursorOptions :: Return an array of cursor options"><span class="description">Return an array of cursor options</span><pre>getCursorOptions()</pre></a></li></ul>
</li>
<li class="nav-header">
<i class="icon-custom icon-property"></i> Properties
                    <ul></ul>
</li>
<li class="nav-header private">» Private
                    <ul><li class="property private inherited"><a href="#property__connection" title="$_connection :: Connection object"><span class="description">Connection object</span><pre>$_connection</pre></a></li></ul>
</li>
<li class="nav-header">
<i class="icon-custom icon-constant"></i> Constants
                    <ul>
<li class="constant  "><a href="#constant_ENTRY_DOCUMENTS" title="ENTRY_DOCUMENTS :: documents array index"><span class="description">documents array index</span><pre>ENTRY_DOCUMENTS</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_ATTRIBUTE" title="OPTION_ATTRIBUTE :: attribute parameter"><span class="description">attribute parameter</span><pre>OPTION_ATTRIBUTE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_CLOSED" title="OPTION_CLOSED :: closed parameter"><span class="description">closed parameter</span><pre>OPTION_CLOSED</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_COLLECTION" title="OPTION_COLLECTION :: collection parameter"><span class="description">collection parameter</span><pre>OPTION_COLLECTION</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_COUNT" title="OPTION_COUNT :: count option"><span class="description">count option</span><pre>OPTION_COUNT</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_DISTANCE" title="OPTION_DISTANCE :: distance parameter"><span class="description">distance parameter</span><pre>OPTION_DISTANCE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_EXAMPLE" title="OPTION_EXAMPLE :: example parameter"><span class="description">example parameter</span><pre>OPTION_EXAMPLE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_FIELDS" title="OPTION_FIELDS :: count fields"><span class="description">count fields</span><pre>OPTION_FIELDS</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_FIGURES" title="OPTION_FIGURES :: figures option"><span class="description">figures option</span><pre>OPTION_FIGURES</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_LATITUDE" title="OPTION_LATITUDE :: latidude parameter"><span class="description">latidude parameter</span><pre>OPTION_LATITUDE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_LEFT" title="OPTION_LEFT :: left parameter"><span class="description">left parameter</span><pre>OPTION_LEFT</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_LIMIT" title="OPTION_LIMIT :: limit parameter"><span class="description">limit parameter</span><pre>OPTION_LIMIT</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_LONGITUDE" title="OPTION_LONGITUDE :: longitude parameter"><span class="description">longitude parameter</span><pre>OPTION_LONGITUDE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_RADIUS" title="OPTION_RADIUS :: radius parameter"><span class="description">radius parameter</span><pre>OPTION_RADIUS</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_RENAME" title="OPTION_RENAME :: rename option"><span class="description">rename option</span><pre>OPTION_RENAME</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_RIGHT" title="OPTION_RIGHT :: right parameter"><span class="description">right parameter</span><pre>OPTION_RIGHT</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_SKIP" title="OPTION_SKIP :: skip parameter"><span class="description">skip parameter</span><pre>OPTION_SKIP</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_TRUNCATE" title="OPTION_TRUNCATE :: truncate option"><span class="description">truncate option</span><pre>OPTION_TRUNCATE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_TYPE" title="OPTION_TYPE :: count unique"><span class="description">count unique</span><pre>OPTION_TYPE</pre></a></li>
<li class="constant  "><a href="#constant_OPTION_UNIQUE" title="OPTION_UNIQUE :: count unique"><span class="description">count unique</span><pre>OPTION_UNIQUE</pre></a></li>
</ul>
</li>
</ul>
</div>
<div class="span8">
<a id="\triagens\ArangoDb\CollectionHandler"></a><ul class="breadcrumb">
<li>
<a href="../index.html"><i class="icon-custom icon-class"></i></a><span class="divider">\</span>
</li>
<li><a href="../namespaces/triagens.html">triagens</a></li>
<li>
<span class="divider">\</span><a href="../namespaces/triagens.ArangoDb.html">ArangoDb</a>
</li>
<li class="active">
<span class="divider">\</span><a href="../classes/triagens.ArangoDb.CollectionHandler.html">CollectionHandler</a>
</li>
</ul>
<div class="element class">
<p class="short_description">A collection handler that fetches collection data from the server and
creates collections on the server.</p>
<div class="details">
<div class="long_description"><p>It does so by issuing the
appropriate HTTP requests to the server.</p></div>
<table class="table table-bordered"><tr>
<th>package</th>
<td><a href="../packages/ArangoDbPhpClient.html">ArangoDbPhpClient</a></td>
</tr></table>
<h3>
<i class="icon-custom icon-method"></i> Methods</h3>
<a id="method___construct"></a><div class="element clickable method public method___construct" data-toggle="collapse" data-target=".method___construct .collapse">
<h2>Construct a new handler</h2>
<pre>__construct(\triagens\ArangoDb\Connection $connection) : void</pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\triagens\ArangoDb\Handler::__construct()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$connection</h4>
<code><a href="../classes/triagens.ArangoDb.Connection.html">\triagens\ArangoDb\Connection</a></code><ul>
<li>connection to be used</li>
</ul>
</div>
</div></div>
</div>
<a id="method_add"></a><div class="element clickable method public method_add" data-toggle="collapse" data-target=".method_add .collapse">
<h2>Adds a new collection on the server</h2>
<pre>add(\triagens\ArangoDb\Collection $collection) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will add the collection on the server and return its id</p>

<p>This will throw if the collection cannot be created</p></div>
<table class="table table-bordered"><tr>
<th>deprecated</th>
<td>to be removed in version 2.0 - This function is being replaced by create()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code><a href="../classes/triagens.ArangoDb.Collection.html">\triagens\ArangoDb\Collection</a></code><ul>
<li>collection object to be created on the server</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>- id of collection created</div>
</div></div>
</div>
<a id="method_byExample"></a><div class="element clickable method public method_byExample" data-toggle="collapse" data-target=".method_byExample .collapse">
<h2>Get document(s) by specifying an example</h2>
<pre>byExample(mixed $collectionId, mixed $document, bool | array $options) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the list cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as string or number</li>
</ul>
</div>
<div class="subelement argument">
<h4>$document</h4>
<code>mixed</code><ul>
<li>the example document as a Document object or an array</li>
</ul>
</div>
<div class="subelement argument">
<h4>$options</h4>
<code>bool</code><code>array</code><ul>
<li>optional, prior to v1.0.0 this was a boolean value for sanitize, since v1.0.0 it's an array of options. </li>
</ul>

<p>Options are : <li>'sanitize' - true to remove _id and _rev attributes from result documents. Defaults to false.</li> <li>'hiddenAttributes' - set an array of hidden attributes for created documents. <p> This is actually the same as setting hidden attributes using setHiddenAttributes() on a document. The difference is, that if you're returning a resultset of documents, the getall() is already called and the hidden attributes would not be applied to the attributes. </p> </li> </p>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- documents matching the example [0...n]</div>
</div></div>
</div>
<a id="method_count"></a><div class="element clickable method public method_count" data-toggle="collapse" data-target=".method_count .collapse">
<h2>Get the number of documents in a collection</h2>
<pre>count(mixed $collectionId) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the collection cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as a string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>- the number of documents in the collection</div>
</div></div>
</div>
<a id="method_create"></a><div class="element clickable method public method_create" data-toggle="collapse" data-target=".method_create .collapse">
<h2>Creates a new collection on the server</h2>
<pre>create(\triagens\ArangoDb\Collection $collection) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will add the collection on the server and return its id</p>

<p>This will throw if the collection cannot be created</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code><a href="../classes/triagens.ArangoDb.Collection.html">\triagens\ArangoDb\Collection</a></code><ul>
<li>collection object to be created on the server</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>- id of collection created</div>
</div></div>
</div>
<a id="method_delete"></a><div class="element clickable method public method_delete" data-toggle="collapse" data-target=".method_delete .collapse">
<h2>Delete a collection</h2>
<pre>delete(mixed $collection) : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>deprecated</th>
<td>to be removed in version 2.0 - This function is being replaced by drop()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code>mixed</code><ul>
<li>collection id as string or number or collection object</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>bool</code>- always true, will throw if there is an error</div>
</div></div>
</div>
<a id="method_drop"></a><div class="element clickable method public method_drop" data-toggle="collapse" data-target=".method_drop .collapse">
<h2>Drop a collection</h2>
<pre>drop(mixed $collection) : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code>mixed</code><ul>
<li>collection id as string or number or collection object</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>bool</code>- always true, will throw if there is an error</div>
</div></div>
</div>
<a id="method_figures"></a><div class="element clickable method public method_figures" data-toggle="collapse" data-target=".method_figures .collapse">
<h2>Get figures for a collection</h2>
<pre>figures(mixed $collectionId) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the collection cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as a string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- the figures for the collection</div>
</div></div>
</div>
<a id="method_get"></a><div class="element clickable method public method_get" data-toggle="collapse" data-target=".method_get .collapse">
<h2>Get information about a collection</h2>
<pre>get(mixed $collectionId) : <a href="../classes/triagens.ArangoDb.Collection.html">\triagens\ArangoDb\Collection</a></pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the collection cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as a string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code><a href="../classes/triagens.ArangoDb.Collection.html">\triagens\ArangoDb\Collection</a></code>- the collection fetched from the server</div>
</div></div>
</div>
<a id="method_getAllIds"></a><div class="element clickable method public method_getAllIds" data-toggle="collapse" data-target=".method_getAllIds .collapse">
<h2>Get the list of all documents' ids from a collection</h2>
<pre>getAllIds(mixed $collectionId) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the list cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- ids of documents in the collection</div>
</div></div>
</div>
<a id="method_getCount"></a><div class="element clickable method public method_getCount" data-toggle="collapse" data-target=".method_getCount .collapse">
<h2>Get the number of documents in a collection</h2>
<pre>getCount(mixed $collectionId) : int</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the collection cannot be fetched from the server</p></div>
<table class="table table-bordered"><tr>
<th>deprecated</th>
<td>to be removed in version 2.0 - This function is being replaced by count()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as a string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>int</code>- the number of documents in the collection</div>
</div></div>
</div>
<a id="method_getFigures"></a><div class="element clickable method public method_getFigures" data-toggle="collapse" data-target=".method_getFigures .collapse">
<h2>Get figures for a collection</h2>
<pre>getFigures(mixed $collectionId) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the collection cannot be fetched from the server</p></div>
<table class="table table-bordered"><tr>
<th>deprecated</th>
<td>to be removed in version 2.0 - This function is being replaced by figures()</td>
</tr></table>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as a string or number</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- the figures for the collection</div>
</div></div>
</div>
<a id="method_index"></a><div class="element clickable method public method_index" data-toggle="collapse" data-target=".method_index .collapse">
<h2>Creates an index on a collection on the server</h2>
<pre>index(mixed $collectionId, string $type, array $attributes, boolean $unique) : mixed</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will create an index on the collection on the server and return its id</p>

<p>This will throw if the index cannot be created</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>The id of the collection where the index is to be created</li>
</ul>
</div>
<div class="subelement argument">
<h4>$type</h4>
<code>string</code><ul>
<li>index type: hash, skiplist or geo</li>
</ul>
</div>
<div class="subelement argument">
<h4>$attributes</h4>
<code>array</code><ul>
<li>an array of attributes that can be defined like array('a') or array('a', 'b.c')</li>
</ul>
</div>
<div class="subelement argument">
<h4>$unique</h4>
<code>boolean</code><ul>
<li>true/false to create a unique index</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>mixed</code>- id of collection created</div>
</div></div>
</div>
<a id="method_near"></a><div class="element clickable method public method_near" data-toggle="collapse" data-target=".method_near .collapse">
<h2>Get document(s) by specifying near</h2>
<pre>near(mixed $collectionId, double $latitude, double $longitude, array $options) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the list cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as string or number</li>
</ul>
</div>
<div class="subelement argument">
<h4>$latitude</h4>
<code>double</code><ul>
<li>The latitude of the coordinate.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$longitude</h4>
<code>double</code><ul>
<li>The longitude of the coordinate.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$options</h4>
<code>array</code><ul>
<li>optional array of options. </li>
</ul>

<p>Options are : <li>'sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li> <li>'hiddenAttributes' - Set an array of hidden attributes for created documents. <p> This is actually the same as setting hidden attributes using setHiddenAttributes() on a document. The difference is, that if you're returning a resultset of documents, the getall() is already called and the hidden attributes would not be applied to the attributes. </p> <li>'distance' - If given, the attribute key used to store the distance. (optional) <li>'skip' - The documents to skip in the query. <li>'limit' - The maximal amount of documents to return. </li> </p>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- documents matching the example [0...n]</div>
</div></div>
</div>
<a id="method_range"></a><div class="element clickable method public method_range" data-toggle="collapse" data-target=".method_range .collapse">
<h2>Get document(s) by specifying range</h2>
<pre>range(mixed $collectionId, string $attribute, mixed $left, mixed $right, array $options) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the list cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as string or number</li>
</ul>
</div>
<div class="subelement argument">
<h4>$attribute</h4>
<code>string</code><ul>
<li>the attribute path , like 'a', 'a.b', etc...</li>
</ul>
</div>
<div class="subelement argument">
<h4>$left</h4>
<code>mixed</code><ul>
<li>The lower bound.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$right</h4>
<code>mixed</code><ul>
<li>The upper bound.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$options</h4>
<code>array</code><ul>
<li>optional array of options. </li>
</ul>

<p>Options are : <li>'sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li> <li>'hiddenAttributes' - Set an array of hidden attributes for created documents. <p> This is actually the same as setting hidden attributes using setHiddenAttributes() on a document. The difference is, that if you're returning a resultset of documents, the getall() is already called and the hidden attributes would not be applied to the attributes. </p> <li>'closed' - If true, use interval including left and right, otherwise exclude right, but include left. <li>'skip' - The documents to skip in the query. <li>'limit' - The maximal amount of documents to return. </li> </p>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- documents matching the example [0...n]</div>
</div></div>
</div>
<a id="method_rename"></a><div class="element clickable method public method_rename" data-toggle="collapse" data-target=".method_rename .collapse">
<h2>Rename a collection</h2>
<pre>rename(mixed $collection, string $name) : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code>mixed</code><ul>
<li>collection id as string or number or collection object</li>
</ul>
</div>
<div class="subelement argument">
<h4>$name</h4>
<code>string</code><ul>
<li>new name for collection</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>bool</code>- always true, will throw if there is an error</div>
</div></div>
</div>
<a id="method_truncate"></a><div class="element clickable method public method_truncate" data-toggle="collapse" data-target=".method_truncate .collapse">
<h2>Truncate a collection</h2>
<pre>truncate(mixed $collection) : bool</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will remove all documents from the collection but will leave the metadata and indexes intact.</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collection</h4>
<code>mixed</code><ul>
<li>collection id as string or number or collection object</li>
</ul>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>bool</code>- always true, will throw if there is an error</div>
</div></div>
</div>
<a id="method_within"></a><div class="element clickable method public method_within" data-toggle="collapse" data-target=".method_within .collapse">
<h2>Get document(s) by specifying within</h2>
<pre>within(mixed $collectionId, double $latitude, double $longitude, int $radius, array $options) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"><p>This will throw if the list cannot be fetched from the server</p></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$collectionId</h4>
<code>mixed</code><ul>
<li>collection id as string or number</li>
</ul>
</div>
<div class="subelement argument">
<h4>$latitude</h4>
<code>double</code><ul>
<li>The latitude of the coordinate.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$longitude</h4>
<code>double</code><ul>
<li>The longitude of the coordinate.</li>
</ul>
</div>
<div class="subelement argument">
<h4>$radius</h4>
<code>int</code><ul>
<li>The maximal radius (in meters).</li>
</ul>
</div>
<div class="subelement argument">
<h4>$options</h4>
<code>array</code><ul>
<li>optional array of options. </li>
</ul>

<p>Options are : <li>'sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li> <li>'hiddenAttributes' - Set an array of hidden attributes for created documents. <p> This is actually the same as setting hidden attributes using setHiddenAttributes() on a document. The difference is, that if you're returning a resultset of documents, the getall() is already called and the hidden attributes would not be applied to the attributes. </p> <li>'distance' - If given, the attribute key used to store the distance. (optional) <li>'skip' - The documents to skip in the query. <li>'limit' - The maximal amount of documents to return. </li> </p>
</div>
<h3>Exceptions</h3>
<table class="table table-bordered"><tr>
<th><code><a href="../classes/triagens.ArangoDb.Exception.html">\triagens\ArangoDb\Exception</a></code></th>
<td></td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- documents matching the example [0...n]</div>
</div></div>
</div>
<a id="method_getConnection"></a><div class="element clickable method protected method_getConnection" data-toggle="collapse" data-target=".method_getConnection .collapse">
<h2>Return the connection object</h2>
<pre>getConnection() : <a href="../classes/triagens.ArangoDb.Connection.html">\triagens\ArangoDb\Connection</a></pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered"><tr>
<th>inherited_from</th>
<td>\triagens\ArangoDb\Handler::getConnection()</td>
</tr></table>
<h3>Returns</h3>
<div class="subelement response">
<code><a href="../classes/triagens.ArangoDb.Connection.html">\triagens\ArangoDb\Connection</a></code>- the connection object</div>
</div></div>
</div>
<a id="method_getCursorOptions"></a><div class="element clickable method private method_getCursorOptions" data-toggle="collapse" data-target=".method_getCursorOptions .collapse">
<h2>Return an array of cursor options</h2>
<pre>getCursorOptions(bool $sanitize) : array</pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<h3>Parameters</h3>
<div class="subelement argument">
<h4>$sanitize</h4>
<code>bool</code><ul>
<li>sanitize flag</li>
</ul>
</div>
<h3>Returns</h3>
<div class="subelement response">
<code>array</code>- array of options</div>
</div></div>
</div>
<h3>
<i class="icon-custom icon-property"></i> Properties</h3>
<a id="property__connection"> </a><div class="element clickable property private property__connection" data-toggle="collapse" data-target=".property__connection .collapse">
<h2>Connection object</h2>
<pre>$_connection </pre>
<div class="labels"><span class="label">Inherited</span></div>
<div class="row collapse"><div class="detail-description">
<div class="long_description"></div>
<table class="table table-bordered">
<tr>
<th>param</th>
<td><p>Connection</p></td>
</tr>
<tr>
<th>inherited_from</th>
<td>\triagens\ArangoDb\Handler::$$_connection</td>
</tr>
</table>
</div></div>
</div>
<h3>
<i class="icon-custom icon-constant"></i> Constants</h3>
<a id="constant_ENTRY_DOCUMENTS"> </a><div class="element clickable constant  constant_ENTRY_DOCUMENTS" data-toggle="collapse" data-target=".constant_ENTRY_DOCUMENTS .collapse">
<h2>documents array index</h2>
<pre>ENTRY_DOCUMENTS </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_ATTRIBUTE"> </a><div class="element clickable constant  constant_OPTION_ATTRIBUTE" data-toggle="collapse" data-target=".constant_OPTION_ATTRIBUTE .collapse">
<h2>attribute parameter</h2>
<pre>OPTION_ATTRIBUTE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_CLOSED"> </a><div class="element clickable constant  constant_OPTION_CLOSED" data-toggle="collapse" data-target=".constant_OPTION_CLOSED .collapse">
<h2>closed parameter</h2>
<pre>OPTION_CLOSED </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_COLLECTION"> </a><div class="element clickable constant  constant_OPTION_COLLECTION" data-toggle="collapse" data-target=".constant_OPTION_COLLECTION .collapse">
<h2>collection parameter</h2>
<pre>OPTION_COLLECTION </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_COUNT"> </a><div class="element clickable constant  constant_OPTION_COUNT" data-toggle="collapse" data-target=".constant_OPTION_COUNT .collapse">
<h2>count option</h2>
<pre>OPTION_COUNT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_DISTANCE"> </a><div class="element clickable constant  constant_OPTION_DISTANCE" data-toggle="collapse" data-target=".constant_OPTION_DISTANCE .collapse">
<h2>distance parameter</h2>
<pre>OPTION_DISTANCE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_EXAMPLE"> </a><div class="element clickable constant  constant_OPTION_EXAMPLE" data-toggle="collapse" data-target=".constant_OPTION_EXAMPLE .collapse">
<h2>example parameter</h2>
<pre>OPTION_EXAMPLE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_FIELDS"> </a><div class="element clickable constant  constant_OPTION_FIELDS" data-toggle="collapse" data-target=".constant_OPTION_FIELDS .collapse">
<h2>count fields</h2>
<pre>OPTION_FIELDS </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_FIGURES"> </a><div class="element clickable constant  constant_OPTION_FIGURES" data-toggle="collapse" data-target=".constant_OPTION_FIGURES .collapse">
<h2>figures option</h2>
<pre>OPTION_FIGURES </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_LATITUDE"> </a><div class="element clickable constant  constant_OPTION_LATITUDE" data-toggle="collapse" data-target=".constant_OPTION_LATITUDE .collapse">
<h2>latidude parameter</h2>
<pre>OPTION_LATITUDE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_LEFT"> </a><div class="element clickable constant  constant_OPTION_LEFT" data-toggle="collapse" data-target=".constant_OPTION_LEFT .collapse">
<h2>left parameter</h2>
<pre>OPTION_LEFT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_LIMIT"> </a><div class="element clickable constant  constant_OPTION_LIMIT" data-toggle="collapse" data-target=".constant_OPTION_LIMIT .collapse">
<h2>limit parameter</h2>
<pre>OPTION_LIMIT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_LONGITUDE"> </a><div class="element clickable constant  constant_OPTION_LONGITUDE" data-toggle="collapse" data-target=".constant_OPTION_LONGITUDE .collapse">
<h2>longitude parameter</h2>
<pre>OPTION_LONGITUDE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_RADIUS"> </a><div class="element clickable constant  constant_OPTION_RADIUS" data-toggle="collapse" data-target=".constant_OPTION_RADIUS .collapse">
<h2>radius parameter</h2>
<pre>OPTION_RADIUS </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_RENAME"> </a><div class="element clickable constant  constant_OPTION_RENAME" data-toggle="collapse" data-target=".constant_OPTION_RENAME .collapse">
<h2>rename option</h2>
<pre>OPTION_RENAME </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_RIGHT"> </a><div class="element clickable constant  constant_OPTION_RIGHT" data-toggle="collapse" data-target=".constant_OPTION_RIGHT .collapse">
<h2>right parameter</h2>
<pre>OPTION_RIGHT </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_SKIP"> </a><div class="element clickable constant  constant_OPTION_SKIP" data-toggle="collapse" data-target=".constant_OPTION_SKIP .collapse">
<h2>skip parameter</h2>
<pre>OPTION_SKIP </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_TRUNCATE"> </a><div class="element clickable constant  constant_OPTION_TRUNCATE" data-toggle="collapse" data-target=".constant_OPTION_TRUNCATE .collapse">
<h2>truncate option</h2>
<pre>OPTION_TRUNCATE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_TYPE"> </a><div class="element clickable constant  constant_OPTION_TYPE" data-toggle="collapse" data-target=".constant_OPTION_TYPE .collapse">
<h2>count unique</h2>
<pre>OPTION_TYPE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
<a id="constant_OPTION_UNIQUE"> </a><div class="element clickable constant  constant_OPTION_UNIQUE" data-toggle="collapse" data-target=".constant_OPTION_UNIQUE .collapse">
<h2>count unique</h2>
<pre>OPTION_UNIQUE </pre>
<div class="labels"></div>
<div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div>
</div>
</div>
</div>
</div>
</div>
<div class="row"><footer class="span12">
            Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br>
            Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor 2.0.0a10</a> and<br>
            generated on 2012-12-05T20:49:15+02:00.<br></footer></div>
</div>
</body>
</html>
Return current item: ArangoDB-PHP