- Added a new @PrimaryKey annotation to replace the too-specific property-wise @Id

This commit is contained in:
Dave Mc Nicoll committed 2022-11-11 13:57:29 +00:00
1 parent 0e8443b1c1
commit b20e537038
6 files changed
+33 -19

No files matched your search

+3 -3
View File
@@ -6,11 +6,11 @@ namespace Ulmus\Annotation\Property\Field;
* Since we need consistancy between the declaration of our ID and FK fields, it
* was decided to extend the Id class instead of Field for this case.
*/
class ForeignKey extends Id {
class ForeignKey extends PrimaryKey {
public function __construct()
public function __construct(? string $type = null, ? int $length = null)
{
parent::__construct();
parent::__construct($type, $length);
unset($this->nullable);
$this->attributes['primary_key'] = false;