@param array $data

@throws \Psr\Container\NotFoundExceptionInterface
166344
public function putCategory($data = [])
    {
        $client = $this->getClient();
        $errors = [];

        if ($client) {
            if ($category = $this->getCategory($data['code'])) {
                $result = $client->patch($category, $data);
            } else {
                $result = $client->post($this->getItemCategoriesURL(), $data);
            }
            $errors = array_merge($errors, $client->getErrors($result));
            if (count($errors)) {
                Injector::inst()->get(LoggerInterface::class)->error('putCategory errors - ' . json_encode($errors));
            }
        }
    }
233030
public function set(array $data)
    {
        $this->data = [];
        $this->replace = false;

        foreach ($data as $key => $value) {
            $this->add($key, $value);
        }
    }
610657
private function add(array $data)
    {
        foreach ($this->sanitize($data) as $row) {
            if (!is_array($row) || (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT])) {
                $this->addFlatFromArray($row);
            } else {
                if (!isset($this->_options['objectType'])) {
                    $this->addDocumentsFromArray($row);
                } else {
                    switch ($this->_options['objectType']) {
                        case 'edge' :
                            $this->addEdgesFromArray($row);
                            break;
                        case 'vertex' :
                            $this->addVerticesFromArray($row);
                            break;
                        case 'path' :
                            $this->addPathsFromArray($row);
                            break;
                        case 'shortestPath' :
                            $this->addShortestPathFromArray($row);
                            break;
                        case 'distanceTo' :
                            $this->addDistanceToFromArray($row);
                            break;
                        case 'commonNeighbors' :
                            $this->addCommonNeighborsFromArray($row);
                            break;
                        case 'commonProperties' :
                            $this->addCommonPropertiesFromArray($row);
                            break;
                        case 'figure' :
                            $this->addFigureFromArray($row);
                            break;
                        default :
                            $this->addDocumentsFromArray($row);
                            break;
                    }
                }
            }
        }
    }
1076792
public function setup($data = array())
	{

		foreach (self::$_KEYS as $k)
		{
			if (array_key_exists($k, $data))
			{
				$this->_API[$k] = self::verifySetup($k, $data[$k]);
			}
		}
	}
604192
public function exchangeArray(array $data): void
    {
        foreach ($data as $key => $value) {
            $this->{$key} = (!empty($value)) ? $value : null;
        }
    }
1349829
public function setContainerId(array $data = []) : void
    {
        $config = empty($data) ? $this->getConfig() : $data;

        $this->containerId = self::GRAPH_PREFIX . $config['slug'];
    }
1047551
public function failed(array $data)
    {
        $command = unserialize($data['command']);

        if (method_exists($command, 'failed')) {
            $command->failed($e);
        }
    }
983570
public function failed(array $data)
    {
        $handler = $this->container->make($data['class']);

        if (method_exists($handler, 'failed')) {
            call_user_func_array(array($handler, 'failed'), unserialize($data['data']));
        }
    }
713488
public function insert(array $data): self
    {
        $this->reset();
        // simply check is not assoc to prepare multi-insert
        if (!isset($data[0])) {
            $data = [$data];
        }

        return $this->push('insert', $data);
    }
268529
public function setStartInsert(array $data)
    {
        $columnsAndMarkers = $this->getColumnsAndGetMarkersForInsert($data);

        $this->setStart(
            "INSERT INTO ".$this->model->getDbTable()." (".$columnsAndMarkers['columns'].")
             VALUES (".$columnsAndMarkers['markers'].")"
        );
    }
938185
public function broadcast($event, $data)
    {
        if(!array_key_exists($event, $this->events)) {
            throw new EventNotFoundException("Event [ {$event} ] does not exists.");
        }

        $this->broadcast[$event] = $data;
    }
1202133
private function setData(array $data)
    {
        $this->data = (array) $data;

        // remove reserved stuff
        if (isset($this->data[self::VAR_CONTROLLER])) {
            unset($this->data[self::VAR_CONTROLLER]);
        }

        return !empty($this->data);
    }
204287
public function setLoginData(array $data)
    {
        $data = Helpers::parseLoginData($data);
        $this->getUser()->setLoginData($data[User::ID_LOGIN], $data[User::ID_ROLE], $data[User::ID_UNIT], $data[User::LOGOUT_DATE]);
    }
1148412
public function data($data)
    {
        if ($data instanceof Arrayable) {
            $data = $data->toArray();
        }

        $this->data = $data;
    }
242120
private function fixDataType(array &$data): void
    {
        if ('default' === $data['type']) {
            return;
        }

        $valid_var_name = [
            'image' => 'images',
            'video' => 'video',
        ];

        if (!isset($valid_var_name[$data['type']], $data[$valid_var_name[$data['type']]]) || !\is_array($data[$valid_var_name[$data['type']]])) {
            $data['type'] = 'default';
        }
    }
773594
protected function loadData(array $data = [])
    {
        foreach ($data as $key => $value) {
            if (property_exists($this, $key)) {
                $this->$key = $value;
            }
        }
    }
322229
private function addDocumentsFromArray(array $data)
    {
        $_documentClass = $this->_documentClass;

        $this->_result[] = $_documentClass::createFromArray($data, $this->_options);
    }