- WIP on attributes

This commit is contained in:
Dave Mc Nicoll committed 2023-01-26 18:47:53 +00:00
1 parent e6d0279c1a
commit 70021d829d
13 files changed
+174 -36

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ namespace Ulmus\Attribute\Obj;
#[\Attribute(\Attribute::TARGET_CLASS)]
class Table {
public function __construct(
public string $name,
public ? string $name = null,
public ? string $database = null,
public ? string $schema = null,
public ? string $adapter = null,
+18
View File
@@ -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,
) {}
}
+18
View File
@@ -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,
) {}
}
+18
View File
@@ -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,
) {}
}
+18
View File
@@ -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,
) {}
}
+18
View File
@@ -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);
}
}
+18
View File
@@ -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,
) {}
}
+1 -1
View File
@@ -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,