src/Entity/ItemLabel.php line 39
<?phpdeclare(strict_types=1);namespace App\Entity;use ApiPlatform\Core\Annotation\ApiResource;use ApiPlatform\Core\Annotation\ApiSubresource;use App\Controller\Api\Action\ItemLabel\ItemLabelGetAction;use App\Entity\Mapped\Entity;use App\Repository\ItemLabelRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: ItemLabelRepository::class)]#[ORM\Table(name: 'item_label')]#[ApiResource(collectionOperations: ['post' => ['validation_groups' => ['create']],'get_list' => ['controller' => ItemLabelGetAction::class,'method' => 'GET','path' => '/item/{id}/labels']],itemOperations: ['get','delete',])]class ItemLabel extends Entity{#[ORM\ManyToOne(targetEntity: Item::class,cascade: ['persist'],inversedBy: 'label')]#[ORM\JoinColumn(name: 'item',onDelete: 'CASCADE')]#[Assert\NotBlank(groups: ['create'])]#[ApiSubresource]private ?Item $item = null;#[ORM\ManyToOne(targetEntity: Label::class,cascade: ['persist'],inversedBy: 'itemLabel')]#[ORM\JoinColumn(name: 'label',onDelete: 'CASCADE')]#[Assert\NotBlank(groups: ['create'])]#[ApiSubresource]private ?Label $label = null;public function getItem(): ?Item{return $this->item;}public function setItem(?Item $item): self{$this->item = $item;return $this;}public function getLabel(): ?Label{return $this->label;}public function setLabel(?Label $label): self{$this->label = $label;return $this;}}