@@ -706,19 +706,21 @@ public function isValidCollectionId($collectionId)
706
706
return !$ collectionId || !(is_string ($ collectionId ) || is_float ($ collectionId ) || is_int ($ collectionId ));
707
707
}
708
708
709
- /**
710
- * Get list of all available collections per default with the collection names as index.
711
- * Returns empty array if none are available.
712
- *
713
- * @param array $options - optional - an array of options.
714
- * <p>Options are :<br>
715
- * <li>'excludeSystem' - With a value of true, all system collections will be excluded from the response.</li>
716
- * <li>'keys' - With a value of "collections", the index of the resulting array is numerical,
717
- * With a value of "names", the index of the resulting array are the collection names.</li>
718
- * </p>
719
- *
720
- * @return array
721
- */
709
+ /**
710
+ * Get list of all available collections per default with the collection names as index.
711
+ * Returns empty array if none are available.
712
+ *
713
+ * @param array $options - optional - an array of options.
714
+ * <p>Options are :<br>
715
+ * <li>'excludeSystem' - With a value of true, all system collections will be excluded from the response.</li>
716
+ * <li>'keys' - With a value of "collections", the index of the resulting array is numerical,
717
+ * With a value of "names", the index of the resulting array are the collection names.</li>
718
+ * </p>
719
+ *
720
+ * @return array
721
+ * @throws \triagens\ArangoDb\Exception
722
+ * @throws \triagens\ArangoDb\ClientException
723
+ */
722
724
public function getAllCollections (array $ options = [])
723
725
{
724
726
$ options = array_merge (['excludeSystem ' => false , 'keys ' => 'result ' ], $ options );
@@ -898,18 +900,19 @@ public function import(
898
900
}
899
901
900
902
901
- /**
902
- * Create a hash index
903
- *
904
- * @param string $collectionId - the collection id
905
- * @param array $fields - an array of fields
906
- * @param boolean $unique - whether the values in the index should be unique or not
907
- * @param boolean $sparse - whether the index should be sparse
908
- *
909
- * @link https://docs.arangodb.com/HttpIndexes/Hash.html
910
- *
911
- * @return array - server response of the created index
912
- */
903
+ /**
904
+ * Create a hash index
905
+ *
906
+ * @param string $collectionId - the collection id
907
+ * @param array $fields - an array of fields
908
+ * @param boolean $unique - whether the values in the index should be unique or not
909
+ * @param boolean $sparse - whether the index should be sparse
910
+ *
911
+ * @link https://docs.arangodb.com/HttpIndexes/Hash.html
912
+ *
913
+ * @return array - server response of the created index
914
+ * @throws \triagens\ArangoDb\Exception
915
+ */
913
916
public function createHashIndex ($ collectionId , array $ fields , $ unique = null , $ sparse = null )
914
917
{
915
918
$ indexOptions = [];
@@ -924,17 +927,18 @@ public function createHashIndex($collectionId, array $fields, $unique = null, $s
924
927
return $ this ->index ($ collectionId , self ::OPTION_HASH_INDEX , $ fields , null , $ indexOptions );
925
928
}
926
929
927
- /**
928
- * Create a fulltext index
929
- *
930
- * @param string $collectionId - the collection id
931
- * @param array $fields - an array of fields
932
- * @param int $minLength - the minimum length of words to index
933
- *
934
- * @link https://docs.arangodb.com/HttpIndexes/Fulltext.html
935
- *
936
- * @return array - server response of the created index
937
- */
930
+ /**
931
+ * Create a fulltext index
932
+ *
933
+ * @param string $collectionId - the collection id
934
+ * @param array $fields - an array of fields
935
+ * @param int $minLength - the minimum length of words to index
936
+ *
937
+ * @link https://docs.arangodb.com/HttpIndexes/Fulltext.html
938
+ *
939
+ * @return array - server response of the created index
940
+ * @throws \triagens\ArangoDb\Exception
941
+ */
938
942
public function createFulltextIndex ($ collectionId , array $ fields , $ minLength = null )
939
943
{
940
944
$ indexOptions = [];
@@ -946,18 +950,19 @@ public function createFulltextIndex($collectionId, array $fields, $minLength = n
946
950
return $ this ->index ($ collectionId , self ::OPTION_FULLTEXT_INDEX , $ fields , null , $ indexOptions );
947
951
}
948
952
949
- /**
950
- * Create a skip-list index
951
- *
952
- * @param string $collectionId - the collection id
953
- * @param array $fields - an array of fields
954
- * @param bool $unique - whether the index is unique or not
955
- * @param bool $sparse - whether the index should be sparse
956
- *
957
- * @link https://docs.arangodb.com/HttpIndexes/Skiplist.html
958
- *
959
- * @return array - server response of the created index
960
- */
953
+ /**
954
+ * Create a skip-list index
955
+ *
956
+ * @param string $collectionId - the collection id
957
+ * @param array $fields - an array of fields
958
+ * @param bool $unique - whether the index is unique or not
959
+ * @param bool $sparse - whether the index should be sparse
960
+ *
961
+ * @link https://docs.arangodb.com/HttpIndexes/Skiplist.html
962
+ *
963
+ * @return array - server response of the created index
964
+ * @throws \triagens\ArangoDb\Exception
965
+ */
961
966
public function createSkipListIndex ($ collectionId , array $ fields , $ unique = null , $ sparse = null )
962
967
{
963
968
$ indexOptions = [];
@@ -972,19 +977,20 @@ public function createSkipListIndex($collectionId, array $fields, $unique = null
972
977
return $ this ->index ($ collectionId , self ::OPTION_SKIPLIST_INDEX , $ fields , null , $ indexOptions );
973
978
}
974
979
975
- /**
976
- * Create a geo index
977
- *
978
- * @param string $collectionId - the collection id
979
- * @param array $fields - an array of fields
980
- * @param boolean $geoJson - whether to use geoJson or not
981
- * @param boolean $constraint - whether this is a constraint or not
982
- * @param boolean $ignoreNull - whether to ignore null
983
- *
984
- * @link https://docs.arangodb.com/HttpIndexes/Geo.html
985
- *
986
- * @return array - server response of the created index
987
- */
980
+ /**
981
+ * Create a geo index
982
+ *
983
+ * @param string $collectionId - the collection id
984
+ * @param array $fields - an array of fields
985
+ * @param boolean $geoJson - whether to use geoJson or not
986
+ * @param boolean $constraint - whether this is a constraint or not
987
+ * @param boolean $ignoreNull - whether to ignore null
988
+ *
989
+ * @link https://docs.arangodb.com/HttpIndexes/Geo.html
990
+ *
991
+ * @return array - server response of the created index
992
+ * @throws \triagens\ArangoDb\Exception
993
+ */
988
994
public function createGeoIndex (
989
995
$ collectionId ,
990
996
array $ fields ,
@@ -1060,14 +1066,16 @@ public function index($collectionId, $type = '', array $attributes = [], $unique
1060
1066
}
1061
1067
1062
1068
1063
- /**
1064
- * Get the information about an index in a collection
1065
- *
1066
- * @param string $collection - the id of the collection
1067
- * @param string $indexId - the id of the index
1068
- *
1069
- * @return array
1070
- */
1069
+ /**
1070
+ * Get the information about an index in a collection
1071
+ *
1072
+ * @param string $collection - the id of the collection
1073
+ * @param string $indexId - the id of the index
1074
+ *
1075
+ * @return array
1076
+ * @throws \triagens\ArangoDb\Exception
1077
+ * @throws \triagens\ArangoDb\ClientException
1078
+ */
1071
1079
public function getIndex ($ collection , $ indexId )
1072
1080
{
1073
1081
$ url = UrlHelper::buildUrl (Urls::URL_INDEX , [$ collection , $ indexId ]);
@@ -1146,30 +1154,32 @@ public function any($collectionId)
1146
1154
}
1147
1155
1148
1156
1149
- /**
1150
- * Returns all documents of a collection
1151
- *
1152
- * @param mixed $collectionId - collection id as string or number
1153
- * @param array $options - optional array of options.
1154
- * <p>Options are :<br>
1155
- * <li>'_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li>
1156
- * <li>'sanitize' - Deprecated, please use '_sanitize'.</li>
1157
- * <li>'_hiddenAttributes' - Set an array of hidden attributes for created documents.
1158
- * <li>'hiddenAttributes' - Deprecated, please use '_hiddenAttributes'.</li>
1159
- * <p>
1160
- * This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.<br>
1161
- * The difference is, that if you're returning a resultset of documents, the getAll() is already called<br>
1162
- * and the hidden attributes would not be applied to the attributes.<br>
1163
- * </p>
1164
- *
1165
- * <li>'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch</li>
1166
- * <li>'skip' - Optional, The number of documents to skip in the query.</li>
1167
- * <li>'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.</li>
1168
- * </li>
1169
- * </p>
1170
- *
1171
- * @return Cursor - documents
1172
- */
1157
+ /**
1158
+ * Returns all documents of a collection
1159
+ *
1160
+ * @param mixed $collectionId - collection id as string or number
1161
+ * @param array $options - optional array of options.
1162
+ * <p>Options are :<br>
1163
+ * <li>'_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li>
1164
+ * <li>'sanitize' - Deprecated, please use '_sanitize'.</li>
1165
+ * <li>'_hiddenAttributes' - Set an array of hidden attributes for created documents.
1166
+ * <li>'hiddenAttributes' - Deprecated, please use '_hiddenAttributes'.</li>
1167
+ * <p>
1168
+ * This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.<br>
1169
+ * The difference is, that if you're returning a resultset of documents, the getAll() is already called<br>
1170
+ * and the hidden attributes would not be applied to the attributes.<br>
1171
+ * </p>
1172
+ *
1173
+ * <li>'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch</li>
1174
+ * <li>'skip' - Optional, The number of documents to skip in the query.</li>
1175
+ * <li>'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.</li>
1176
+ * </li>
1177
+ * </p>
1178
+ *
1179
+ * @return Cursor - documents
1180
+ * @throws \triagens\ArangoDb\Exception
1181
+ * @throws \triagens\ArangoDb\ClientException
1182
+ */
1173
1183
public function all ($ collectionId , array $ options = [])
1174
1184
{
1175
1185
$ options = array_merge ($ options , $ this ->getCursorOptions ($ options ));
0 commit comments