<?php
namespace App\Entity;
use App\Repository\CustomerBillingRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass=CustomerBillingRepository::class)
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class CustomerBilling extends BaseEntity
{
use SoftDeleteableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=State::class, inversedBy="customerBillings")
*/
private $state;
/**
* @ORM\ManyToOne(targetEntity=City::class, inversedBy="customerBillings")
*/
private $city;
/**
* @ORM\ManyToOne(targetEntity=Country::class, inversedBy="customerBillings")
*/
private $country;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $address;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $zipCode;
/**
* @ORM\OneToOne(targetEntity=User::class, mappedBy="customerBilling", cascade={"persist", "remove"})
*/
private $user;
public function getId(): ?int
{
return $this->id;
}
public function getState(): ?State
{
return $this->state;
}
public function setState(?State $state): self
{
$this->state = $state;
return $this;
}
public function getCity(): ?City
{
return $this->city;
}
public function setCity(?City $city): self
{
$this->city = $city;
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): self
{
$this->country = $country;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getZipCode(): ?string
{
return $this->zipCode;
}
public function setZipCode(?string $zipCode): self
{
$this->zipCode = $zipCode;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
// unset the owning side of the relation if necessary
if ($user === null && $this->user !== null) {
$this->user->setCustomerBilling(null);
}
// set the owning side of the relation if necessary
if ($user !== null && $user->getCustomerBilling() !== $this) {
$user->setCustomerBilling($this);
}
$this->user = $user;
return $this;
}
}