- Some bugfixes were made, added a new diff before saving results. Also, a new method was added for insert, update and delete respectively for other drivers to override as needed

This commit is contained in:
Dave Mc Nicoll committed 2021-10-19 12:41:04 +00:00
1 parent 58afe841e7
commit dc5e088551
7 files changed
+111 -29

No files matched your search

+3 -3
View File
@@ -106,7 +106,7 @@ class RelationBuilder
protected function applyFilter(Repository $repository, string $name) : Repository
{
foreach($this->filters ?? [] as $filter) {
$repository = call_user_func_array([ $this->entity, $filter->method ], [ $repository, $name ]);
$repository = call_user_func_array([ $this->entity, $filter->method ], [ $repository, $name, false ]);
}
return $repository;
@@ -156,7 +156,7 @@ class RelationBuilder
}
foreach($data ?: $this->entity->entityLoadedDataset as $key => $value) {
if ( $key === sprintf(static::SUBQUERY_FIELD_SUFFIX, $name) ) {
if ( $key === sprintf(static::SUBQUERY_FIELD_SUFFIX, strtolower($name)) ) {
if ($value) {
if ( null === ( $dataset = \json_decode($value, true) ) ) {
throw new \Exception(sprintf("JSON error '%s' from '%s'", \json_last_error_msg(), $value));
@@ -168,7 +168,7 @@ class RelationBuilder
return $entity::entityCollection();
}
}
elseif ( substr($key, 0, $len ) === sprintf(static::JOIN_FIELD_SEPARATOR, $name) ) {
elseif ( substr($key, 0, $len ) === sprintf(static::JOIN_FIELD_SEPARATOR, strtolower($name)) ) {
$vars[substr($key, $len)] = $value;
}
}