Skip to content

Commit 3e380f8

Browse files
committed
Revert "Declare nativeType of parent property explicitly as workaround for bug in symfony TypeInfo"
This reverts commit 2f580c9.
1 parent a5d7a5f commit 3e380f8

File tree

10 files changed

+10
-30
lines changed

10 files changed

+10
-30
lines changed

src/Entity/Attachments/AttachmentType.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
use Doctrine\Common\Collections\Collection;
4848
use Doctrine\ORM\Mapping as ORM;
4949
use Symfony\Component\Serializer\Annotation\Groups;
50-
use Symfony\Component\TypeInfo\Type\NullableType;
51-
use Symfony\Component\TypeInfo\Type\ObjectType;
5250
use Symfony\Component\Validator\Constraints as Assert;
5351

5452
/**
@@ -95,7 +93,7 @@ class AttachmentType extends AbstractStructuralDBElement
9593
#[ORM\ManyToOne(targetEntity: AttachmentType::class, inversedBy: 'children')]
9694
#[ORM\JoinColumn(name: 'parent_id')]
9795
#[Groups(['attachment_type:read', 'attachment_type:write'])]
98-
#[ApiProperty(readableLink: true, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
96+
#[ApiProperty(readableLink: true, writableLink: false)]
9997
protected ?AbstractStructuralDBElement $parent = null;
10098

10199
/**

src/Entity/Parts/Category.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
use Doctrine\Common\Collections\Collection;
5151
use Doctrine\ORM\Mapping as ORM;
5252
use Symfony\Component\Serializer\Annotation\Groups;
53-
use Symfony\Component\TypeInfo\Type\NullableType;
54-
use Symfony\Component\TypeInfo\Type\ObjectType;
5553
use Symfony\Component\Validator\Constraints as Assert;
5654

5755
/**
@@ -100,7 +98,7 @@ class Category extends AbstractPartsContainingDBElement
10098
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
10199
#[ORM\JoinColumn(name: 'parent_id')]
102100
#[Groups(['category:read', 'category:write'])]
103-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
101+
#[ApiProperty(readableLink: false, writableLink: false)]
104102
protected ?AbstractStructuralDBElement $parent = null;
105103

106104
#[Groups(['category:read', 'category:write'])]

src/Entity/Parts/Footprint.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
use Doctrine\Common\Collections\Collection;
5050
use Doctrine\ORM\Mapping as ORM;
5151
use Symfony\Component\Serializer\Annotation\Groups;
52-
use Symfony\Component\TypeInfo\Type\NullableType;
53-
use Symfony\Component\TypeInfo\Type\ObjectType;
5452
use Symfony\Component\Validator\Constraints as Assert;
5553

5654
/**
@@ -95,7 +93,7 @@ class Footprint extends AbstractPartsContainingDBElement
9593
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
9694
#[ORM\JoinColumn(name: 'parent_id')]
9795
#[Groups(['footprint:read', 'footprint:write'])]
98-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
96+
#[ApiProperty(readableLink: false, writableLink: false)]
9997
protected ?AbstractStructuralDBElement $parent = null;
10098

10199
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)]

src/Entity/Parts/Manufacturer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@
4848
use Doctrine\Common\Collections\Collection;
4949
use Doctrine\ORM\Mapping as ORM;
5050
use Symfony\Component\Serializer\Annotation\Groups;
51-
use Symfony\Component\TypeInfo\Type\NullableType;
52-
use Symfony\Component\TypeInfo\Type\ObjectType;
5351
use Symfony\Component\Validator\Constraints as Assert;
5452

5553
/**
@@ -94,7 +92,7 @@ class Manufacturer extends AbstractCompany
9492
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
9593
#[ORM\JoinColumn(name: 'parent_id')]
9694
#[Groups(['manufacturer:read', 'manufacturer:write'])]
97-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
95+
#[ApiProperty(readableLink: false, writableLink: false)]
9896
protected ?AbstractStructuralDBElement $parent = null;
9997

10098
#[ORM\OneToMany(mappedBy: 'parent', targetEntity: self::class)]

src/Entity/Parts/MeasurementUnit.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
use Doctrine\ORM\Mapping as ORM;
5151
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
5252
use Symfony\Component\Serializer\Annotation\Groups;
53-
use Symfony\Component\TypeInfo\Type\NullableType;
54-
use Symfony\Component\TypeInfo\Type\ObjectType;
5553
use Symfony\Component\Validator\Constraints as Assert;
5654
use Symfony\Component\Validator\Constraints\Length;
5755

@@ -132,7 +130,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
132130
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
133131
#[ORM\JoinColumn(name: 'parent_id')]
134132
#[Groups(['measurement_unit:read', 'measurement_unit:write'])]
135-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
133+
#[ApiProperty(readableLink: false, writableLink: false)]
136134
protected ?AbstractStructuralDBElement $parent = null;
137135

138136
/**

src/Entity/Parts/PartCustomState.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646
use Doctrine\Common\Collections\Criteria;
4747
use Doctrine\ORM\Mapping as ORM;
4848
use Symfony\Component\Serializer\Annotation\Groups;
49-
use Symfony\Component\TypeInfo\Type\NullableType;
50-
use Symfony\Component\TypeInfo\Type\ObjectType;
5149
use Symfony\Component\Validator\Constraints as Assert;
5250

5351
/**
@@ -89,7 +87,7 @@ class PartCustomState extends AbstractPartsContainingDBElement
8987
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
9088
#[ORM\JoinColumn(name: 'parent_id')]
9189
#[Groups(['part_custom_state:read', 'part_custom_state:write'])]
92-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
90+
#[ApiProperty(readableLink: false, writableLink: false)]
9391
protected ?AbstractStructuralDBElement $parent = null;
9492

9593
/**

src/Entity/Parts/StorageLocation.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@
5050
use Doctrine\Common\Collections\Collection;
5151
use Doctrine\ORM\Mapping as ORM;
5252
use Symfony\Component\Serializer\Annotation\Groups;
53-
use Symfony\Component\TypeInfo\Type\NullableType;
54-
use Symfony\Component\TypeInfo\Type\ObjectType;
5553
use Symfony\Component\Validator\Constraints as Assert;
5654

5755
/**
@@ -99,7 +97,7 @@ class StorageLocation extends AbstractPartsContainingDBElement
9997
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
10098
#[ORM\JoinColumn(name: 'parent_id')]
10199
#[Groups(['location:read', 'location:write'])]
102-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
100+
#[ApiProperty(readableLink: false, writableLink: false)]
103101
protected ?AbstractStructuralDBElement $parent = null;
104102

105103
#[Groups(['location:read', 'location:write'])]

src/Entity/Parts/Supplier.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
use Doctrine\Common\Collections\Collection;
5454
use Doctrine\ORM\Mapping as ORM;
5555
use Symfony\Component\Serializer\Annotation\Groups;
56-
use Symfony\Component\TypeInfo\Type\NullableType;
57-
use Symfony\Component\TypeInfo\Type\ObjectType;
5856
use Symfony\Component\Validator\Constraints as Assert;
5957

6058
/**
@@ -101,7 +99,7 @@ class Supplier extends AbstractCompany
10199
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
102100
#[ORM\JoinColumn(name: 'parent_id')]
103101
#[Groups(['supplier:read', 'supplier:write'])]
104-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
102+
#[ApiProperty(readableLink: false, writableLink: false)]
105103
protected ?AbstractStructuralDBElement $parent = null;
106104

107105
/**

src/Entity/PriceInformations/Currency.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
use Doctrine\ORM\Mapping as ORM;
5353
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
5454
use Symfony\Component\Serializer\Annotation\Groups;
55-
use Symfony\Component\TypeInfo\Type\NullableType;
56-
use Symfony\Component\TypeInfo\Type\ObjectType;
5755
use Symfony\Component\Validator\Constraints as Assert;
5856

5957
/**
@@ -127,7 +125,7 @@ class Currency extends AbstractStructuralDBElement
127125
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
128126
#[ORM\JoinColumn(name: 'parent_id')]
129127
#[Groups(['currency:read', 'currency:write'])]
130-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
128+
#[ApiProperty(readableLink: false, writableLink: false)]
131129
protected ?AbstractStructuralDBElement $parent = null;
132130

133131
/**

src/Entity/ProjectSystem/Project.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
use Doctrine\ORM\Mapping as ORM;
5050
use InvalidArgumentException;
5151
use Symfony\Component\Serializer\Annotation\Groups;
52-
use Symfony\Component\TypeInfo\Type\NullableType;
53-
use Symfony\Component\TypeInfo\Type\ObjectType;
5452
use Symfony\Component\Validator\Constraints as Assert;
5553
use Symfony\Component\Validator\Context\ExecutionContextInterface;
5654

@@ -97,7 +95,7 @@ class Project extends AbstractStructuralDBElement
9795
#[ORM\ManyToOne(targetEntity: self::class, inversedBy: 'children')]
9896
#[ORM\JoinColumn(name: 'parent_id')]
9997
#[Groups(['project:read', 'project:write'])]
100-
#[ApiProperty(readableLink: false, writableLink: false, nativeType: new NullableType(new ObjectType(self::class)))]
98+
#[ApiProperty(readableLink: false, writableLink: false)]
10199
protected ?AbstractStructuralDBElement $parent = null;
102100

103101
#[Groups(['project:read', 'project:write'])]

0 commit comments

Comments
 (0)