setContent

Replaces the content of the Profile object.

Updating a profile will have no impact until the save method is called.


setContent(data)

Arguments Type Description
data JSON Object Profile content

Return Value

Returns the Profile object.

Usage

Copied to clipboard!

<?php

use Kuzzle\Security\Profile;

// ...

$profileDefinition = [
  'policies' => [
    [
      'roleId' => 'anonymous',
      'restrictedTo' => [
        ['index' => 'my-second-index', 'collection' => ['my-collection']]
      ]
    ]
  ]
];

/*
  * @var $profile Role
  */
$profile->setContent($profileDefinition);