NMRelation cleanup / improvement

This commit is contained in:
2023-01-10 22:12:05 +01:00
parent f14a7a4762
commit 13f7866d42
13 changed files with 303 additions and 272 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace Core\Objects\DatabaseEntity\Attribute;
#[\Attribute(\Attribute::TARGET_PROPERTY)] class BigInt {
private bool $unsigned;
public function __construct(bool $unsigned = false) {
$this->unsigned = $unsigned;
}
public function isUnsigned(): bool {
return $this->unsigned;
}
}

View File

@@ -14,5 +14,4 @@ class Multiple {
public function getClassName(): string {
return $this->className;
}
}

View File

@@ -0,0 +1,32 @@
<?php
namespace Core\Objects\DatabaseEntity\Attribute;
namespace Core\Objects\DatabaseEntity\Attribute;
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class MultipleReference {
private string $className;
private string $thisProperty;
private string $relProperty;
public function __construct(string $className, string $thisProperty, string $relProperty) {
$this->className = $className;
$this->thisProperty = $thisProperty;
$this->relProperty = $relProperty;
}
public function getClassName(): string {
return $this->className;
}
public function getThisProperty(): string {
return $this->thisProperty;
}
public function getRelProperty(): string {
return $this->relProperty;
}
}

View File

@@ -2,6 +2,15 @@
namespace Core\Objects\DatabaseEntity\Attribute;
#[\Attribute(\Attribute::TARGET_PROPERTY)] class Unique {
#[\Attribute(\Attribute::TARGET_PROPERTY|\Attribute::TARGET_CLASS)] class Unique {
private array $columns;
public function __construct(string ...$columns) {
$this->columns = $columns;
}
public function getColumns(): array {
return $this->columns;
}
}