NMRelation cleanup / improvement
This commit is contained in:
16
Core/Objects/DatabaseEntity/Attribute/BigInt.class.php
Normal file
16
Core/Objects/DatabaseEntity/Attribute/BigInt.class.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -14,5 +14,4 @@ class Multiple {
|
||||
public function getClassName(): string {
|
||||
return $this->className;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user