@@ -1211,6 +1211,52 @@ public function range($collectionId, $attribute, $left, $right, $options = array
1211
1211
return new Cursor ($ this ->getConnection (), $ response ->getJson (), $ options );
1212
1212
}
1213
1213
1214
+ /**
1215
+ * Returns all documents of a collection
1216
+ *
1217
+ * @param mixed $collectionId - collection id as string or number
1218
+ * @param array $options - optional array of options.
1219
+ * <p>Options are :<br>
1220
+ * <li>'_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.</li>
1221
+ * <li>'sanitize' - Deprecated, please use '_sanitize'.</li>
1222
+ * <li>'_hiddenAttributes' - Set an array of hidden attributes for created documents.
1223
+ * <li>'hiddenAttributes' - Deprecated, please use '_hiddenAttributes'.</li>
1224
+ * <p>
1225
+ * This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.<br>
1226
+ * The difference is, that if you're returning a resultset of documents, the getAll() is already called<br>
1227
+ * and the hidden attributes would not be applied to the attributes.<br>
1228
+ * </p>
1229
+ *
1230
+ * <li>'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch</li>
1231
+ * <li>'skip' - Optional, The number of documents to skip in the query.</li>
1232
+ * <li>'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.</li>
1233
+ * </li>
1234
+ * </p>
1235
+ *
1236
+ * @return Cursor - documents
1237
+ */
1238
+ public function all ($ collectionId , $ options = array ())
1239
+ {
1240
+ $ options = array_merge ($ options , $ this ->getCursorOptions ($ options ));
1241
+
1242
+ $ body = array (
1243
+ self ::OPTION_COLLECTION => $ collectionId ,
1244
+ );
1245
+
1246
+ $ body = $ this ->includeOptionsInBody (
1247
+ $ options ,
1248
+ $ body ,
1249
+ array (
1250
+ self ::OPTION_LIMIT => null ,
1251
+ self ::OPTION_SKIP => null ,
1252
+ )
1253
+ );
1254
+
1255
+ $ response = $ this ->getConnection ()->put (Urls::URL_ALL , $ this ->json_encode_wrapper ($ body ));
1256
+
1257
+ return new Cursor ($ this ->getConnection (), $ response ->getJson (), $ options );
1258
+ }
1259
+
1214
1260
1215
1261
/**
1216
1262
* Get document(s) by specifying near
0 commit comments