src/Entity/OrderItem.php line 10
<?phpnamespace App\Entity;use App\Repository\OrderItemRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: OrderItemRepository::class)]class OrderItem{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column]#[Assert\NotBlank(message: 'Spécifiez une quantité.')]#[Assert\GreaterThanOrEqual(value: 1, message: 'La quantité doit être supérieure ou égale à 1.')]private ?int $order_item_product_quantity = null;#[ORM\ManyToOne(inversedBy: 'order_items')]#[ORM\JoinColumn(nullable: false)]private ?Order $order_item_order = null;#[ORM\ManyToOne(inversedBy: 'order_items')]#[ORM\JoinColumn(nullable: false)]private ?Product $order_item_product = null;public function getId(): ?int{return $this->id;}public function getOrderItemProductQuantity(): ?int{return $this->order_item_product_quantity;}public function setOrderItemProductQuantity(int $order_item_product_quantity): self{$this->order_item_product_quantity = $order_item_product_quantity;return $this;}public function getOrderItemOrder(): ?Order{return $this->order_item_order;}public function setOrderItemOrder(?Order $order_item_order): self{$this->order_item_order = $order_item_order;return $this;}public function getOrderItemProduct(): ?Product{return $this->order_item_product;}public function setOrderItemProduct(?Product $order_item_product): self{$this->order_item_product = $order_item_product;return $this;}public function __toString(): string{return $this->order_item_product_quantity . ' x ' . $this->order_item_product;}}