From 68485077722fefa1de65c4006b9274d43a7648c5 Mon Sep 17 00:00:00 2001 From: Tom H Anderson Date: Sat, 2 Mar 2024 17:08:27 -0700 Subject: [PATCH] Pass 2 of review Entities --- tests/Assets/Entity/Entity.skipper | 232 ++++++++++++++------------ tests/Assets/Entity/FormEntity.php | 30 ++-- tests/Assets/Entity/ResolveTarget.php | 2 +- 3 files changed, 142 insertions(+), 122 deletions(-) diff --git a/tests/Assets/Entity/Entity.skipper b/tests/Assets/Entity/Entity.skipper index f8568fd9..7e07d9cd 100644 --- a/tests/Assets/Entity/Entity.skipper +++ b/tests/Assets/Entity/Entity.skipper @@ -1,9 +1,6 @@ - - - @@ -45,67 +42,6 @@ EntityWithoutRepository.php - - - - - - - - - - - - - - - - - - - - - - - - - doctrine_orm_module_form_entity - FormEntity.php - - - - - - - - - - - - - - - - - - - - - - - - - - - - AUTO - - - - - FormEntityTarget.php - - @@ -119,38 +55,7 @@ Issue237.php - - - - - AUTO - - - - - - ResolveTarget.php - - - - - - - - - - - - - - AUTO - - - - - TargetEntity.php - - + @@ -232,32 +137,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + doctrine_orm_module_form_entity + FormEntity.php + + + + + + + AUTO + + + + + FormEntityTarget.php + + + + + + + AUTO + + + + + + ResolveTarget.php + + + + + + + AUTO + + + + + TargetEntity.php + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - + - - - + + + - + - + - - - + + + - - - - + + + + + + diff --git a/tests/Assets/Entity/FormEntity.php b/tests/Assets/Entity/FormEntity.php index 073a1711..209cde0d 100644 --- a/tests/Assets/Entity/FormEntity.php +++ b/tests/Assets/Entity/FormEntity.php @@ -62,9 +62,15 @@ class FormEntity #[ORM\Column(type: 'string', nullable: true)] protected string|null $stringNullable = null; + /** + * This join is odd because the targetEntity exists only as an interface + **/ #[ORM\OneToOne(targetEntity: Target::class)] protected Target $targetOne; + /** + * This join is odd because the targetEntity exists only as an interface + */ #[ORM\OneToOne(targetEntity: Target::class)] #[ORM\JoinColumn(nullable: true)] protected Target|null $targetOneNullable = null; @@ -84,6 +90,13 @@ class FormEntity #[ORM\Column(type: 'integer')] protected int $specificType; + /** + * @Form\Options({"label":"Please Choose", "value_options":{"f":"false","t":"true"}}) + * @Form\Attributes({"type":"textarea"}) + */ + #[ORM\Column(type: 'integer')] + protected int $specificAttributeType; + /** * @Form\Type("DoctrineORMModule\Form\Element\EntityMultiCheckbox") * @@ -92,22 +105,17 @@ class FormEntity #[ORM\OneToMany(targetEntity: FormEntityTarget::class, mappedBy: 'formEntityMulti')] protected array $specificMultiType; + /** @var Target[] */ + #[ORM\OneToMany(targetEntity: FormEntityTarget::class, mappedBy: 'formEntity')] + protected array $targetMany; + /** + * This join is odd because the targetEntity exists only as an interface + * * @Form\Type("DoctrineModule\Form\Element\ObjectSelect") * @Form\Options({"empty_option":null}) */ #[ORM\OneToOne(targetEntity: Target::class)] #[ORM\JoinColumn(nullable: true)] protected Target|null $noDisplayEmptyOption = null; - - /** @var Target[] */ - #[ORM\OneToMany(targetEntity: FormEntityTarget::class, mappedBy: 'formEntity')] - protected array $targetMany; - - /** - * @Form\Options({"label":"Please Choose", "value_options":{"f":"false","t":"true"}}) - * @Form\Attributes({"type":"textarea"}) - */ - #[ORM\Column(type: 'integer')] - protected int $specificAttributeType; } diff --git a/tests/Assets/Entity/ResolveTarget.php b/tests/Assets/Entity/ResolveTarget.php index c28c74ef..11012445 100644 --- a/tests/Assets/Entity/ResolveTarget.php +++ b/tests/Assets/Entity/ResolveTarget.php @@ -15,6 +15,6 @@ class ResolveTarget protected int $id; #[ORM\ManyToOne(targetEntity: Target::class)] - #[ORM\JoinColumn(name: 'target_id', referencedColumnName: 'id')] + #[ORM\JoinColumn(name: 'target_id', referencedColumnName: 'id', unique: true)] protected Target $target; }