diff --git a/src/Attribute/ConstrainActionEnum.php b/src/Attribute/ConstrainActionEnum.php new file mode 100644 index 0000000..e4c58f8 --- /dev/null +++ b/src/Attribute/ConstrainActionEnum.php @@ -0,0 +1,14 @@ +foreignKey = Attribute::handleArrayField($this->foreignKey, false); + $this->references = Attribute::handleArrayField($this->references, false); + } +} diff --git a/src/Attribute/Obj/Index.php b/src/Attribute/Obj/Index.php new file mode 100644 index 0000000..4cd773f --- /dev/null +++ b/src/Attribute/Obj/Index.php @@ -0,0 +1,14 @@ +references = Attribute::handleArrayField($this->references, false); + #$this->references = Attribute::handleArrayField($this->references, false); } } diff --git a/src/Attribute/Property/Index.php b/src/Attribute/Property/Index.php index 70e6311..0d0fae9 100644 --- a/src/Attribute/Property/Index.php +++ b/src/Attribute/Property/Index.php @@ -2,20 +2,11 @@ namespace Ulmus\Attribute\Property; +use Ulmus\Attribute\IndexTypeEnum; + #[\Attribute(\Attribute::TARGET_PROPERTY)] class Index { - - public const TYPE_PRIMARY = 'primary'; - - public const TYPE_INDEX = 'index'; - - public const TYPE_UNIQUE = 'unique'; - - public const TYPE_SPATIAL = 'spatial'; - - public const TYPE_FULLTEXT = 'fulltext'; - public function __construct( - public string $type = self::TYPE_INDEX, + public IndexTypeEnum $type = IndexTypeEnum::Index, ) {} -} +} \ No newline at end of file diff --git a/src/Attribute/Property/Unique.php b/src/Attribute/Property/Unique.php new file mode 100644 index 0000000..0889633 --- /dev/null +++ b/src/Attribute/Property/Unique.php @@ -0,0 +1,13 @@ +entityClass = $entityClass;