From 0012a31e6bea1050385f6b740581f32b9e366128 Mon Sep 17 00:00:00 2001 From: Mirzaev Date: Wed, 26 Oct 2022 06:16:30 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D1=85=D0=B0=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=20=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B8=20=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=B0=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=B1?= =?UTF-8?q?=D1=8B=D0=BB=20=D0=BF=D0=BE=D1=80=D1=83=D0=B1=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BA?= =?UTF-8?q?=D1=83=D1=81=D0=BE=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mirzaev/arangodb/system/document.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mirzaev/arangodb/system/document.php b/mirzaev/arangodb/system/document.php index 4fd9d6a..a6b389c 100644 --- a/mirzaev/arangodb/system/document.php +++ b/mirzaev/arangodb/system/document.php @@ -26,18 +26,17 @@ class document * @param _connection $session Сессия соединения с базой данных * @param string $collection Коллекция * @param ?array $data Данные - * @param ?array $metadata Метаданные * @param bool $check Проверка на запись в базу данных * @param ?terminal $terminal Инстанция терминала * * @return string|null Идентификатор */ - public static function write(_connection $session, string $collection, ?array $data = [], ?array $metadata = [], bool $check = false, ?terminal $terminal = null): ?string + public static function write(_connection $session, string $collection, ?array $data = [], bool $check = false, ?terminal $terminal = null): ?string { // Инициализация коллекции - collection::init($session, $collection, isset($metadata['_from'], $metadata['_to'])); + collection::init($session, $collection, isset($data['_from'], $data['_to'])); - if (isset($metadata['_from'], $metadata['_to'])) { + if (isset($data['_from'], $data['_to'])) { // Ребро // Инициализация обработчика рёбер @@ -47,11 +46,11 @@ class document $document = new _edge(); // Инициализация вершин - $_from = $metadata['_from']; - $_to = $metadata['_to']; + $_from = $data['_from']; + $_to = $data['_to']; // Деинициализация из входных данных - unset($metadata['_from'], $metadata['_to']); + unset($data['_from'], $data['_to']); } else { // Вершина @@ -62,7 +61,7 @@ class document $document = new _document(); } - foreach (['data' => $data, 'metadata' => ($metadata ?? []) + ['created' => time()]] as $key => $value) { + foreach (['created' => time()] + $data as $key => $value) { // Перебор параметров // Запись в инстанцию документа @@ -98,7 +97,8 @@ class document * * @return bool Статус обработки */ - public static function update(_connection $session, _document $document): bool { + public static function update(_connection $session, _document $document): bool + { // Инициализация обработчика вершин $documents = new _document_handler($session);