Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Column | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Dynart\Micro\Entities\Attribute; |
| 4 | |
| 5 | use Attribute; |
| 6 | |
| 7 | #[Attribute(Attribute::TARGET_PROPERTY)] |
| 8 | class Column { |
| 9 | |
| 10 | const TYPE_INT = 'int'; |
| 11 | const TYPE_LONG = 'long'; |
| 12 | const TYPE_FLOAT = 'float'; |
| 13 | const TYPE_DOUBLE = 'double'; |
| 14 | const TYPE_NUMERIC = 'numeric'; |
| 15 | const TYPE_STRING = 'string'; |
| 16 | const TYPE_BOOL = 'bool'; |
| 17 | const TYPE_DATE = 'date'; |
| 18 | const TYPE_TIME = 'time'; |
| 19 | const TYPE_DATETIME = 'datetime'; |
| 20 | const TYPE_BLOB = 'blob'; |
| 21 | |
| 22 | const ACTION_CASCADE = 'cascade'; |
| 23 | const ACTION_SET_NULL = 'set_null'; |
| 24 | |
| 25 | const NOW = 'now'; |
| 26 | |
| 27 | public function __construct( |
| 28 | public string $type, |
| 29 | public int|array $size = 0, |
| 30 | public bool $fixSize = false, |
| 31 | public bool $notNull = false, |
| 32 | public bool $autoIncrement = false, |
| 33 | public bool $primaryKey = false, |
| 34 | public mixed $default = null, |
| 35 | public ?array $foreignKey = null, |
| 36 | public ?string $onDelete = null, |
| 37 | public ?string $onUpdate = null, |
| 38 | ) {} |
| 39 | } |