DB: Pass callback to serializer

This commit is contained in:
root 2022-12-03 23:24:58 +01:00
parent 548a2376d4
commit 00eac092d0

View File

@ -202,7 +202,7 @@ class JsonDatabase implements IJsonUnflattener
return [];
$serIdentifier = self::SanitizeIdentifier(strval($serIdentifier));
if (empty($serIdentifier) || empty($serClass))
if (empty($serIdentifier) || empty($serClass) || empty($findClass))
return [];
$serPath = $this->getObjectPath($serClass, $serIdentifier) . self::$EXTENSION_INDEX;
@ -220,8 +220,8 @@ class JsonDatabase implements IJsonUnflattener
return [];
// TODO: Check if the referenced objects exist on disk
if (array_key_exists(get_class($findClass), $indexJson))
return $indexJson[get_class($findClass)];
if (array_key_exists($findClass, $indexJson))
return $indexJson[$findClass];
else
return [];
}
@ -245,7 +245,7 @@ class JsonDatabase implements IJsonUnflattener
if (strlen($objPath) > PHP_MAXPATHLEN)
throw new Exception('JsonDatabase: Specified Path ' . $objPath . ' is longer than allowed.');
$objJson = $obj->Serialize(nested: $this->nested, to_array: false);
$objJson = $obj->Serialize(nested: $this->nested, to_array: false, callback: $this);
if ($this->audit)
{