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.

setHeaders #

This is a helper function returning itself, allowing to easily set headers while chaining calls.


setHeaders(content, [replace]) #

ArgumentsTypeDescription
contentJSON ObjectNew content
replacebooleantrue: replace the current content with the provided data, false: merge it

Note: by default, the replace argument is set to false


Return value #

Returns the Collection object to allow chaining.

Usage #

<?php
use \Kuzzle\Kuzzle;
$headers = [
  'someContent' => 'someValue'
];
$kuzzle = new Kuzzle('localhost');
$dataCollection = $kuzzle->collection('collection', 'index');
$dataCollection->setHeaders($headers, true);