- WIP on attributes ; on testing phase
This commit is contained in:
1 parent
5295a335b3
commit
e6d0279c1a
44 files changed
+763
-142
No files matched your search
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Ulmus\Attribute\Property\Field;
|
||||
|
||||
/**
|
||||
* Since we need consistancy between the declaration of our ID and FK fields, it
|
||||
* was decided to extend the PK class instead of Field for this case.
|
||||
*/
|
||||
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
||||
class ForeignKey extends PrimaryKey {
|
||||
public function __construct(
|
||||
public ? string $name = null,
|
||||
public ? string $type = 'bigint',
|
||||
public ? int $length = null,
|
||||
public ? int $precision = null,
|
||||
public array $attributes = [
|
||||
'primary_key' => false,
|
||||
'auto_increment' => false
|
||||
],
|
||||
public bool $nullable = false,
|
||||
public mixed $default = null,
|
||||
public bool $readonly = false,
|
||||
) {}
|
||||
}
|
||||
Reference in new issue
Block a user