src/Entity/Client.php line 16
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\ClientRepository;use App\Traits\Timestamps;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ClientRepository::class)]#[ApiResource()]#[ORM\HasLifecycleCallbacks]class Client{use Timestamps;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $url = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $website = null;#[ORM\Column(length: 255, nullable: true)]private ?string $plan = null;#[ORM\Column(length: 255, nullable: true)]private ?string $status = null;#[ORM\ManyToOne(inversedBy: 'client')]private ?Plan $planClient = null;#[ORM\Column(nullable: true)]private ?bool $deleted = null;#[ORM\Column(length: 255)]private ?string $externalId = null;#[ORM\OneToMany(mappedBy: 'client', targetEntity: Order::class)]private Collection $orders;#[ORM\OneToOne(mappedBy: 'client', cascade: ['persist', 'remove'])]private ?Billing $billing = null;public function __construct(){$this->orders = 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 getUrl(): ?string{return $this->url;}public function setUrl(?string $url): self{$this->url = $url;return $this;}public function getWebsite(): ?string{return $this->website;}public function setWebsite(?string $website): self{$this->website = $website;return $this;}public function getPlan(): ?string{return $this->plan;}public function setPlan(?string $plan): self{$this->plan = $plan;return $this;}public function getStatus(): ?string{return $this->status;}public function setStatus(?string $status): self{$this->status = $status;return $this;}public function __toString(): string{return $this->name ?? '';}public function getPlanClient(): ?Plan{return $this->planClient;}public function setPlanClient(?Plan $planClient): static{$this->planClient = $planClient;return $this;}public function isDeleted(): ?bool{return $this->deleted;}public function setDeleted(bool $deleted): static{$this->deleted = $deleted;return $this;}public function getExternalId(): ?string{return $this->externalId;}public function setExternalId(string $externalId): self{$this->externalId = $externalId;return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): static{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setClient($this);}return $this;}public function removeOrder(Order $order): static{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getClient() === $this) {$order->setClient(null);}}return $this;}public function getBilling(): ?Billing{return $this->billing;}public function setBilling(Billing $billing): static{// set the owning side of the relation if necessaryif ($billing->getClient() !== $this) {$billing->setClient($this);}$this->billing = $billing;return $this;}}