Added decode/encode support in DB overwrite method
This commit is contained in:
parent
78b49cd045
commit
49e24b726d
1 changed files with 7 additions and 1 deletions
|
@ -315,13 +315,19 @@ class Database
|
||||||
throw new AuthorizationException($validator->getDescription()); // var_dump($validator->getDescription()); return false;
|
throw new AuthorizationException($validator->getDescription()); // var_dump($validator->getDescription()); return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$new = $this->encode($new);
|
||||||
|
|
||||||
$validator = new Structure($this);
|
$validator = new Structure($this);
|
||||||
|
|
||||||
if (!$validator->isValid($new)) { // Make sure updated structure still apply collection rules (if any)
|
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;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue