This commit is contained in:
2023-01-11 15:28:47 +01:00
parent 4c51403daa
commit 05fd209204
7 changed files with 61 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ abstract class DatabaseEntity implements ArrayAccess, JsonSerializable {
}
}
if ($propertyNames === null) {
if ($propertyNames === null && !empty($this->customData)) {
$jsonArray = array_merge($jsonArray, $this->customData);
}

View File

@@ -74,6 +74,9 @@ class DatabaseEntityHandler implements Persistable {
}
public function init() {
$className = $this->entityClass->getName();
$uniqueColumns = self::getAttribute($this->entityClass, Unique::class);
if ($uniqueColumns) {
$this->constraints[] = new \Core\Driver\SQL\Constraint\Unique($uniqueColumns->getColumns());

View File

@@ -58,9 +58,9 @@ class NMRelation implements Persistable {
public function getOtherHandler(DatabaseEntityHandler $handler): DatabaseEntityHandler {
if ($handler === $this->thisHandler) {
return $this->thisHandler;
} else {
return $this->otherHandler;
} else {
return $this->thisHandler;
}
}
}