- Some small bugfixes made

This commit is contained in:
mcndave committed 2023-07-09 12:38:52 -04:00
1 parent a4743b471c
commit 01ab6e82d4
6 files changed
+55 -8

No files matched your search

+15 -1
View File
@@ -10,6 +10,17 @@ use Ulmus\Attribute\Attribute;
*/
#[\Attribute(\Attribute::TARGET_PROPERTY)]
class ForeignKey extends PrimaryKey {
public const SET_NULL = "null";
public const SET_DEFAULT = "default";
public const RESTRICT = "restrict";
public const NO_ACTION = "noaction";
public const CASCADE = "cascade";
public function __construct(
public ? string $name = null,
public ? string $type = 'bigint',
@@ -22,8 +33,11 @@ class ForeignKey extends PrimaryKey {
public bool $nullable = false,
public mixed $default = null,
public bool $readonly = false,
public null|array|string|\Stringable $foreignKey = "",
public null|array|string|\Stringable $references = null,
public null|string $onDelete = self::NO_ACTION,
public null|string $onUpdate = self::NO_ACTION,
) {
$this->references = Attribute::handleArrayField($this->references);
$this->references = Attribute::handleArrayField($this->references, false);
}
}