Create a new user in Kuzzle.

@param integer $id Unique user identifier, will be used as username
@param array $content Data representing the user
@param array $options Optional arguments
@return User
559695
public function createUser($id, array $content, array $options = [])
    {
        $action = 'createUser';
        $data = [
            '_id' => $id,
            'body' => $content
        ];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs($action),
            $data,
            $options
        );

        return new User($this, $response['result']['_id'], $response['result']['_source'], $response['result']['_meta']);
    }
375713
public function update(array $content, array $options = [])
    {
        $data = [
            '_id' => $this->id,
            'body' => $content
        ];

        $response = $this->security->getKuzzle()->query(
            $this->security->buildQueryArgs($this->updateActionName),
            $data,
            $options
        );

        $this->setContent($response['result']['_source']);

        return $this;
    }
981775
protected function createUserModel($username, $password, array $options = [])
    {
        $user = $this->newUserModel($username, $password, $options);
        $user->save();

        return $user;
    }
217622
static function create( $contentObjectID, $userIdentifier, $creatorID = false )
    {
        $timestamp = time();

        if ( $creatorID === false )
        {
            $user = eZUser::currentUser();
            $creatorID = $user->id();
        }
        $row = array( 'contentobject_id' => $contentObjectID,
                      'user_identifier' => $userIdentifier,
                      'creator_id' => $creatorID,
                      'created' => $timestamp,
                      'modified' => $timestamp );
        return new eZInformationCollection( $row );
    }
797567
public static function create($user_id, $params, $options = null)
    {
        $url = static::classUrlWithUserId($user_id);
        return static::_directRequest('post', $url, $params, $options);
    }
280082
public function display($content, $options = [])
    {
        if (is_numeric($content)) {
            $user = User::find($content);
        }
        $content = !empty($user) && $user->getName() ? $user->getName() : $content;
        return parent::display($content, $options);
    }
714988
public static function create($userId, $params = null, $options = null)
    {
        return self::_userBasedCreate($userId, $params, $options);
    }
389697
public function getById($id, array $options = [])
    {
        $query = $this->createBaseBuilder($options);

        return $query->find($id);
    }
610981
public function initialize(array $data, array $options = []): NodeInterface
    {
        if (!isset($data['id']) || !is_string($data['id']) || $data['id'] === '') {
            throw ValidationException::create('Field "id" must be a non-empty string.');
        }

        if (!preg_match('/^[0-9a-z\_]+$/i', $data['id'])) {
            throw ValidationException::create(
                'Field "id" must have only characters 0-9, a-z, A-Z or "_". Received: '.$data['id']
            );
        }

        $this->setId($data['id']);

        $this->addSubscriber($this);

        if (isset($data['name'])) {
            if (!is_string($data['name']) || $data['name'] === '') {
                throw ValidationException::create('Field "name" must be a non-empty string.');
            }

            $this->setName($data['name']);
        }

        if (isset($data['type'])) {
            if (!is_string($data['type']) || $data['type'] === '') {
                throw ValidationException::create('Field "type" must be a non-empty string.');
            }

            if (!preg_match('/^[0-9a-z\_]+$/i', $data['type'])) {
                throw ValidationException::create(
                    'Field "type" must have only characters 0-9, a-z, A-Z or "_". Received: '.$data['type']
                );
            }

            $this->setType($data['type']);
        }


        if (isset($data['metadata'])) {
            if (!is_array($data['metadata'])) {
                throw ValidationException::create('Field "metadata" must be an array.');
            }

            $this->setMetadata($data['metadata']);
        }

        if (isset($data['parent'])) {
            if (!is_object($data['parent'])
                || !($data['parent'] instanceof NodeInterface)
            ) {
                throw ValidationException::create(
                    'Field "parent" must be an instance of NodeInterface.'
                );
            }

            $this->addParent($data['parent']);
        }

        if (isset($data['children'])) {
            if (!is_array($data['children'])) {
                throw ValidationException::create('Field "children" must be an array.');
            }

            foreach ($data['children'] as $node) {
                if (!is_object($node) || !($node instanceof NodeInterface)) {
                    throw ValidationException::create(
                        'Field "children" must be an array of NodeInterface instances.'
                    );
                }

                $node->addParent($this);

                $this->addChild($node);
            }
        }

        return $this;
    }
1153488
public static JsonBooleanDocument create(String id, Boolean content) {
        return new JsonBooleanDocument(id, 0, content, 0, null);
    }
1216537
public function value($options = [], $content = '')
    {
        if (!is_array($options)) {
            $options = ['value' => $options];
        }

        $this->values[] = new Option($this->form->expression('option'), $options, $content);
        return $this;
    }
660905
public function createExec(?string $id,
                               array $cmd = null,
                               array $env = null,
                               string $user,
                               string $workingDir,
                               array $other)
    {
        $url = self::$base_url.'/'.($id ?? $this->container_id).'/exec';

        $data = [
            'Cmd' => $cmd,
            'Env' => $env,
            'User' => $user,
            'WorkingDir' => $workingDir,
        ];

        $request = json_encode(array_merge($data, $other));

        return self::$curl->post($url, $request, self::$header);
    }
1073493
public function add($content = NULL, $options = [])
    {
			if (!empty($content)) $options['content'] = $content;
      $this->notifications->push(new Notification($options));
      return $this->flash();
    }
1000923
protected function createMenuItem(string $id, array $options): ?ItemInterface
    {
        return $this->factory->createItem($id, $options);
    }
344792
public function getSeasonById($id, array $options = [])
    {
        $options['access_token'] = $this->blizzardClient->getAccessToken();

        return $this->request('/data/d3/season/'.(int) $id, $options);
    }
660012
public function createTask(string $content, array $options = [])
    {
        if ('' === $content) {
            return false;
        }

        unset($options['content']);
        $data   = $this->prepareRequestData(array_merge(['content' => $content], $options));
        $result = $this->post('tasks', $data);

        $status = $result->getStatusCode();
        if (200 === $status) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
1152613
public function postEvent($id, $event, $options = [ ]) {
        $data = $options;
        $data['id'] = $id;
        $data['event'] = $event;

        $result = $this->apiPost('event', $data);
        return $result;
    }