1
0
Fork 0
mirror of synced 2024-06-28 11:10:46 +12:00

Added decode/encode support in DB overwrite method

This commit is contained in:
Eldad Fux 2020-08-09 18:03:28 +03:00
parent 78b49cd045
commit 49e24b726d

View file

@ -315,13 +315,19 @@ class Database
throw new AuthorizationException($validator->getDescription()); // var_dump($validator->getDescription()); return false;
}
$new = $this->encode($new);
$validator = new Structure($this);
if (!$validator->isValid($new)) { // Make sure updated structure still apply collection rules (if any)
throw new StructureException($validator->getDescription()); // var_dump($validator->getDescription()); return false;
}
return new Document($this->adapter->updateDocument($data));
$new = new Document($this->adapter->updateDocument($new->getArrayCopy()));
$new = $this->decode($new);
return $new;
}
/**