src/Entity/OrderType.php line 13
<?phpnamespace App\Entity;use App\Repository\OrderTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: OrderTypeRepository::class)]class OrderType{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\OneToMany(mappedBy: 'orderType', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToMany(mappedBy: 'orderType', targetEntity: RuleCondition::class)]private Collection $ruleConditions;public function __construct(){$this->orders = new ArrayCollection();$this->ruleConditions = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setOrderType($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getOrderType() === $this) {$order->setOrderType(null);}}return $this;}/*** @return Collection<int, RuleCondition>*/public function getRuleConditions(): Collection{return $this->ruleConditions;}public function addRuleCondition(RuleCondition $ruleCondition): static{if (!$this->ruleConditions->contains($ruleCondition)) {$this->ruleConditions->add($ruleCondition);$ruleCondition->setOrderType($this);}return $this;}public function removeRuleCondition(RuleCondition $ruleCondition): static{if ($this->ruleConditions->removeElement($ruleCondition)) {// set the owning side to null (unless already changed)if ($ruleCondition->getOrderType() === $this) {$ruleCondition->setOrderType(null);}}return $this;}public function __toString(): string{return (string)$this->name;}}