- WIP on attributes
This commit is contained in:
1 parent
e6d0279c1a
commit
70021d829d
13 files changed
+174
-36
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Bit extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "bit",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Decimal extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "decimal",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Float extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "float",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Mediumint extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "mediumint",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Numeric extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "numeric",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Smallint extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "smallint",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Timestamp extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(? string $type = "timestamp", ? int $length = null)
|
||||
{
|
||||
parent::__construct($type, $length);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class Tinytext extends \Ulmus\Attribute\Property\Field
|
||||
{
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = "tinytext",
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ use Ulmus\Attribute\Attribute;
|
||||
class Join {
|
||||
public function __construct(
|
||||
public string $type,
|
||||
public null|string|\Stringable $key = null,
|
||||
public null|string|\Stringable|array $key = null,
|
||||
public null|string|\Stringable $foreignKey = null,
|
||||
public null|string $entity = null,
|
||||
public null|string $alias = null,
|
||||
|
||||
Reference in new issue
Block a user