From 786d16f2a4f3decc4a01bd750fefb81ede925660 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 7 Jul 2023 16:31:03 +0000 Subject: [PATCH 1/2] feat: update for database migrations --- src/Database/Database.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index f51e806ed..d01144571 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -1642,10 +1642,12 @@ public function encode(Document $collection, Document $document): Document $filters = $attribute['filters'] ?? []; $value = $document->getAttribute($key, null); + var_dump("Encoding attribute ", $key, $value, $filters); + // continue on optional param with no default - if (is_null($value) && is_null($default)) { - continue; - } + // if (is_null($value) && is_null($default)) { // comment now to run migrations + // continue; + // } // assign default only if no no value provided if (is_null($value) && !is_null($default)) { From a2dbf60de98868b885ce23c0370f2f484d15c272 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Fri, 7 Jul 2023 17:40:54 +0000 Subject: [PATCH 2/2] feat: update encode method --- src/Database/Database.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Database/Database.php b/src/Database/Database.php index d01144571..bc25e3d68 100644 --- a/src/Database/Database.php +++ b/src/Database/Database.php @@ -1642,8 +1642,6 @@ public function encode(Document $collection, Document $document): Document $filters = $attribute['filters'] ?? []; $value = $document->getAttribute($key, null); - var_dump("Encoding attribute ", $key, $value, $filters); - // continue on optional param with no default // if (is_null($value) && is_null($default)) { // comment now to run migrations // continue; @@ -1657,11 +1655,11 @@ public function encode(Document $collection, Document $document): Document } foreach ($value as &$node) { - if (($node !== null)) { - foreach ($filters as $filter) { - $node = $this->encodeAttribute($filter, $node, $document); - } + // if (($node !== null)) { + foreach ($filters as $filter) { + $node = $this->encodeAttribute($filter, $node, $document); } + // } } if (!$array) {