<?php
namespace App\Entity;
use App\Repository\AddressesRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AddressesRepository::class)]
class Addresses
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Clinics::class, inversedBy: 'addresses')]
private $clinic;
#[ORM\Column(type: 'string', length: 255)]
private $address;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isDefault;
#[ORM\Column(type: 'datetime')]
private $modified;
#[ORM\Column(type: 'datetime')]
private $created;
#[ORM\OneToMany(targetEntity: Orders::class, mappedBy: 'address')]
private $orders;
#[ORM\OneToMany(targetEntity: Orders::class, mappedBy: 'billingAddress')]
private $billingAddress;
#[ORM\Column(type: 'string', length: 255)]
private $clinicName;
#[ORM\Column(type: 'string', length: 255)]
private $telephone;
#[ORM\Column(type: 'string', length: 255)]
private $city;
#[ORM\Column(type: 'string', length: 255)]
private $state;
#[ORM\Column(type: 'string', length: 255)]
private $postalCode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $suite;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isActive;
#[ORM\Column(type: 'integer', nullable: true)]
private $type;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isDefaultBilling;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $isoCode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $intlCode;
public function __construct()
{
$this->setCreated(new \DateTime());
if ($this->getModified() == null) {
$this->setModified(new \DateTime());
}
$this->orders = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getClinic(): ?Clinics
{
return $this->clinic;
}
public function setClinic(?Clinics $clinic): self
{
$this->clinic = $clinic;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getIsDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
/**
* @return Collection|Orders[]
*/
public function getOrders(): Collection
{
return $this->orders;
}
public function addOrder(Orders $order): self
{
if (!$this->orders->contains($order)) {
$this->orders[] = $order;
$order->setAddress($this);
}
return $this;
}
public function removeOrder(Orders $order): self
{
if ($this->orders->removeElement($order)) {
// set the owning side to null (unless already changed)
if ($order->getAddress() === $this) {
$order->setAddress(null);
}
}
return $this;
}
public function getClinicName(): ?string
{
return $this->clinicName;
}
public function setClinicName(string $clinicName): self
{
$this->clinicName = $clinicName;
return $this;
}
public function getTelephone(): ?string
{
return $this->telephone;
}
public function setTelephone(string $telephone): self
{
$this->telephone = $telephone;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(string $state): self
{
$this->state = $state;
return $this;
}
public function getPostalCode(): ?string
{
return $this->postalCode;
}
public function setPostalCode(string $postalCode): self
{
$this->postalCode = $postalCode;
return $this;
}
public function getSuite(): ?string
{
return $this->suite;
}
public function setSuite(?string $suite): self
{
$this->suite = $suite;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(?bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(?int $type): self
{
$this->type = $type;
return $this;
}
public function getIsDefaultBilling(): ?bool
{
return $this->isDefaultBilling;
}
public function setIsDefaultBilling(?bool $isDefaultBilling): self
{
$this->isDefaultBilling = $isDefaultBilling;
return $this;
}
public function getIsoCode(): ?string
{
return $this->isoCode;
}
public function setIsoCode(?string $isoCode): self
{
$this->isoCode = $isoCode;
return $this;
}
public function getIntlCode(): ?string
{
return $this->intlCode;
}
public function setIntlCode(?string $intlCode): self
{
$this->intlCode = $intlCode;
return $this;
}
}