<?phpnamespace App\Entity;use App\Repository\CartWebhostingRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=CartWebhostingRepository::class) */class CartWebhosting{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity=User::class, inversedBy="cartWebhostings") */ private $client; /** * @ORM\Column(type="string", length=255) */ private $session_id; /** * @ORM\ManyToOne(targetEntity=ProductWebhosting::class, inversedBy="cartWebhostings") */ private $product_webhosting; /** * @ORM\OneToMany(targetEntity=CartDomain::class, mappedBy="cart_webhosting") */ private $cartDomains; /** * @ORM\Column(type="decimal", precision=10, scale=2) */ private $monthly_price; /** * @ORM\Column(type="datetime", nullable=true) */ private $reg_datetime; public function __construct() { $this->cartDomains = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getClient(): ?User { return $this->client; } public function setClient(?User $client): self { $this->client = $client; return $this; } public function getSessionId(): ?string { return $this->session_id; } public function setSessionId(string $session_id): self { $this->session_id = $session_id; return $this; } public function getProductWebhosting(): ?ProductWebhosting { return $this->product_webhosting; } public function setProductWebhosting(?ProductWebhosting $product_webhosting): self { $this->product_webhosting = $product_webhosting; return $this; } /** * @return Collection<int, CartDomain> */ public function getCartDomains(): Collection { return $this->cartDomains; } public function addCartDomain(CartDomain $cartDomain): self { if (!$this->cartDomains->contains($cartDomain)) { $this->cartDomains[] = $cartDomain; $cartDomain->setCartWebhosting($this); } return $this; } public function removeCartDomain(CartDomain $cartDomain): self { if ($this->cartDomains->removeElement($cartDomain)) { // set the owning side to null (unless already changed) if ($cartDomain->getCartWebhosting() === $this) { $cartDomain->setCartWebhosting(null); } } return $this; } public function getMonthlyPrice(): ?string { return $this->monthly_price; } public function setMonthlyPrice(string $monthly_price): self { $this->monthly_price = $monthly_price; return $this; } public function getRegDatetime(): ?\DateTimeInterface { return $this->reg_datetime; } public function setRegDatetime(?\DateTimeInterface $reg_datetime): self { $this->reg_datetime = $reg_datetime; return $this; }}