|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the API Platform project. |
| 5 | + * |
| 6 | + * (c) Kévin Dunglas <[email protected]> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +declare(strict_types=1); |
| 13 | + |
| 14 | +namespace ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue5793; |
| 15 | + |
| 16 | +use Doctrine\ORM\Mapping as ORM; |
| 17 | +use Symfony\Component\Serializer\Annotation\Groups; |
| 18 | + |
| 19 | +#[ORM\Entity] |
| 20 | +class NonResourceTestEntity |
| 21 | +{ |
| 22 | + #[ORM\Id] |
| 23 | + #[ORM\GeneratedValue] |
| 24 | + #[ORM\Column] |
| 25 | + #[Groups(['read', 'write'])] |
| 26 | + private ?int $id = null; |
| 27 | + #[ORM\Column(length: 255, nullable: true)] |
| 28 | + #[Groups(['read', 'write'])] |
| 29 | + private ?string $nullableString = null; |
| 30 | + |
| 31 | + #[ORM\Column(nullable: true)] |
| 32 | + #[Groups(['read', 'write'])] |
| 33 | + private ?int $nullableInt = null; |
| 34 | + |
| 35 | + #[ORM\ManyToOne(inversedBy: 'tests')] |
| 36 | + private ?BagOfTests $bagOfTests = null; |
| 37 | + |
| 38 | + public function getId(): ?int |
| 39 | + { |
| 40 | + return $this->id; |
| 41 | + } |
| 42 | + |
| 43 | + public function getNullableString(): ?string |
| 44 | + { |
| 45 | + return $this->nullableString; |
| 46 | + } |
| 47 | + |
| 48 | + public function setNullableString(?string $nullableString): static |
| 49 | + { |
| 50 | + $this->nullableString = $nullableString; |
| 51 | + |
| 52 | + return $this; |
| 53 | + } |
| 54 | + |
| 55 | + public function getNullableInt(): ?int |
| 56 | + { |
| 57 | + return $this->nullableInt; |
| 58 | + } |
| 59 | + |
| 60 | + public function setNullableInt(?int $nullableInt): static |
| 61 | + { |
| 62 | + $this->nullableInt = $nullableInt; |
| 63 | + |
| 64 | + return $this; |
| 65 | + } |
| 66 | + |
| 67 | + public function getBagOfTests(): ?BagOfTests |
| 68 | + { |
| 69 | + return $this->bagOfTests; |
| 70 | + } |
| 71 | + |
| 72 | + public function setBagOfTests(?BagOfTests $bagOfTests): static |
| 73 | + { |
| 74 | + $this->bagOfTests = $bagOfTests; |
| 75 | + |
| 76 | + return $this; |
| 77 | + } |
| 78 | +} |
0 commit comments