Выполним действие

@param array $data Массив данных

@return array

@version 14.01.2019
@author  Дмитрий Щербаков <atomcms@ya.ru>
161638
public function run($data)
    {
        $data = (new RunBeforeInsert($this->dic))->run($data);

        $check_auth_id = ORM::for_table('users')
            ->select('id')
            ->where_equal('auth_id', $data['auth_id'])
            ->find_one();
        if (is_object($check_auth_id)) {
            return Response::error400('Пользователь с такими данными для входа уже существует');
        }

        $new_user = ORM::for_table('users')->create();
        $new_user->auth_id = $data['auth_id'];
        $new_user->created_at = $this->dic['datetimenow'];
        $new_user->save();
        if (is_object($new_user) && isset($new_user->id)) {
            $new_user_info = ORM::for_table('info_users')->create();

            if (isset($data['info_users']) && is_array($data['info_users']) && count($data['info_users']) > 0) {
                foreach ($data['info_users'] as $key => $value) {
                    $new_user_info[$key] = $value;
                }
            }

            if (!is_array($data['roles'])) {
                $data['roles'] = [];
            }

            $new_user_info->user_id = $new_user->id;
            $new_user_info->roles = json_encode($data['roles']);
            $new_user_info->created_at = $this->dic['datetimenow'];
            $new_user_info->save();
            if (is_object($new_user_info) && isset($new_user_info->id)) {
                /** @var DataChangeLog $data_change_log */
                $data_change_log = $this->dic['datachangelog'];
                $data_change_log->insert('users', 'insert', $new_user->id, $data);

                $data['id'] = $new_user->id;
                $data['last_action_date'] = 'отсутствует';

                return (new RunAfterInsert($this->dic))->run($data);
            } else {
                return Response::error500('Произошла ошибка при добавлении информации о пользователе, попробуйте ещё раз');
            }
        } else {
            return Response::error500('Произошла ошибка при добавлении пользователя, попробуйте ещё раз');
        }
    }
1336405
public function getChartData(array $data = []) : array
    {
        $chartData = [
            'chart' => $this->type,
            'options' => [
                'element' => $this->getContainerId(),
                'resize' => true,
            ],
        ];

        $options = [
            'data' => $data,
        ];

        $chartData['options'] = array_merge($chartData['options'], $options);

        if (!empty($data)) {
            $this->setData($chartData);
        }

        return $chartData;
    }
1365219
protected function buildArray(array $data)
    {
        $insert_values = [];

        foreach ($data as $key => $value) {
            if ($value === null) {
                $insert_values[] = sprintf('%s => NULL', $this->escape($key));
            } else {
                $insert_values[] = sprintf(
                    '%s => %s',
                    $this->escape($key),
                    $this->escape($value)
                );
            }
        }

        return $insert_values;
    }
1257315
protected function dataToArray (array $data) {
        $result = [];
        foreach ($data as $key => $value) {
            if ($value instanceof ApiEntity) {
                $result[$key] = $value->toArray();
            } else if (is_array($value)) {
                $result[$key] = $this->dataToArray($value);
            } else {
                $result[$key] = $value;
            }
        }
        return $result;
    }
1355221
protected function filter(array $data): array
    {
        $result = [];
        foreach ($data as $key => $value) {
            if ($value['inactive']) {
                continue;
            }

            $result[$key] = $value;
            if (isset($value['children'])) {
                $result[$key]['children'] = $this->filter($value['children']);
            }
        }

        return $result;
    }
605605
public function normalizeData(array $data): array
    {
        $normalizedMetaData = [];
        foreach ($data as $key => $value) {
            $normalizedKey = strtolower($key);
            $normalizedValue = $this->normalizeValues($normalizedKey, $value);
            $normalizedMetaData[$normalizedKey] = $normalizedValue;
        }

        return $normalizedMetaData;
    }
826027
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['type'])) {
            $self->setType($data['type']);
        }
        if (isset($data['translated'])) {
            $self->setTranslated($data['translated']);
        }
        if (isset($data['flagged'])) {
            $self->setFlagged($data['flagged']);
        }
        if (isset($data['status'])) {
            $self->setStatus($data['status']);
        }
        if (isset($data['translation'])) {
            $self->setTranslation($data['translation']);
        }
        if (isset($data['revision'])) {
            $self->setRevision($data['revision']);
        }
        if (isset($data['comments'])) {
            $self->setComments($data['comments']);
        }
        if (isset($data['modified'])) {
            $self->setModified($data['modified']);
        }
        if (isset($data['author'])) {
            $self->setAuthor($data['author']);
        }
        if (isset($data['flagger'])) {
            $self->setFlagger($data['flagger']);
        }
        if (isset($data['locale'])) {
            $self->setLocale($data['locale']);
        }
        if (isset($data['plurals'])) {
            $self->setPlurals($data['plurals']);
        }

        return $self;
    }
794333
protected function prepareData($data)
    {
        if(!is_array($data))
        {
            $data = [];
        }
        
        $data['access_token'] = $this->config->accessToken;
        
        return http_build_query($data);
    }
300913
public function toRet(array $data = [])
    {
        if ($this->isSuccess()) {
            return $this->suc($data + (array) $this->getResponse());
        }

        $e = $this->getErrorException();
        return $this->err($data + ['code' => $e->getCode(), 'message' => $e->getMessage()]);
    }
233067
public function toArray($data)
    {
        $doc = new DomDocument('1.0', 'UTF-8');
        $doc->loadXML($data);
        $element = $doc->documentElement;

        return $this->convertDOMElementToArray($element);
    }
915882
public function createBinds(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof Bind) {
                return $data;
            }

            return Bind::createFromData((array) $data);
        }, $data);
    }
1330376
public function create(array $data)
    {
        $user = User::create([
            'name'                  => $data['name'],
            'email'                 => $data['email'],
            'password'              => bcrypt($data['password']),
            'birthday_at'           => $data['birthday_at'],
            'locale'                => $data['locale'],
            'gender'                => $data['gender'],
            'city'                  => $data['city'],
            'about'                 => $data['about'],
            'profession'            => $data['profession'],
            'hobbies'               => $data['hobbies'],
            'homepage'              => $data['homepage'],
            'skype'                 => $data['skype'],
            'facebook'              => $data['facebook'],
            'twitter'               => $data['twitter'],
            'main_character'        => $data['main_character'],
            'main_guild'            => $data['main_guild'],
            'favorite_race'         => $data['favorite_race'],
            'favorite_spec'         => $data['favorite_spec'],
            'favorite_instance'     => $data['favorite_instance'],
            'favorite_battleground' => $data['favorite_battleground'],
        ]);

        return $user;
    }
1269249
private function getChanges(array $data)
    {
        $changes = [
            'inserted' => Arr::dot($data),
            'updated'  => [],
            'deleted'  => [],
        ];

        foreach ($this->newQuery()->pluck($this->keyColumn) as $key) {
            if (Arr::has($changes['inserted'], $key))
                $changes['updated'][$key] = $changes['inserted'][$key];
            else
                $changes['deleted'][] = $key;

            Arr::forget($changes['inserted'], $key);
        }

        return $changes;
    }
1086447
public static function fromArray(array $data) {
		$ret = new FormOptions();
		foreach($data as $value => $text) {
			$ret->add($value, $text);
		}
		return $ret;
	}
829066
protected function _decodeData(array $data)
    {
        $result = [];

        if (\is_array($data[0])) {
            foreach ($data[0] as $k => $v) {
                $result[$k] = $this->_decodeData([
                    $data[0][$k], $data[1][$k], $data[2][$k], $data[3][$k], $data[4][$k]
                ]);
            }

            return $result;
        }

        return [
            'name' => $data[0],
            'type' => $data[1],
            'tmp_name' => $data[2],
            'error' => $data[3],
            'size' => $data[4]
        ];
    }
875388
protected function formatWeappMessage(array $data = [])
    {
        $params = $this->baseFormat($data, $this->weappMessage);

        $params['data'] = $this->formatData($params['data'] ?? []);

        return $params;
    }
714763
public function cleanArray(array $data)
    {
        $cleanedArray = [];

        foreach ($data as $key => $value) {
            $cleanedArray[$key] = \is_array($value)
                ? $this->cleanArray($value)
                : $this->getSafeArray($key, $data);
        }

        return $cleanedArray;
    }