SDK
SDK PHP v3.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Collection #

In Kuzzle, you manipulate documents and subscriptions, both related to collections.

A collection is a set of data managed by Kuzzle. It acts like a data table for persistent documents, or like a room for pub/sub messages.


Collection(kuzzle, collection, index) #

ArgumentsTypeDescription
kuzzleobjectKuzzle object
collectionstringThe name of the collection you want to manipulate
indexstringName of the index containing the collection

Note: We recommend you instantiate a Collection object by calling Kuzzle.collection rather than using the constructor directly


Properties #

Property nameTypeDescriptionget/set
collectionstringThe name of the collection handled by this instanceget
indexobjectName of the index containing the collectionget
headersobjectHeaders for all sent documents.get/set
kuzzleobjectlinked Kuzzle instanceget

Note: the headers property is inherited from the main Kuzzle object and can be overrided

Usage #

<?php
use \Kuzzle\Kuzzle;
use \Kuzzle\Collection;
$kuzzle = new Kuzzle('localhost');
$dataCollection = new Collection($kuzzle, 'my-collection', 'my-index');