src/Entity/CustomerBilling.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CustomerBillingRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CustomerBillingRepository::class)
  9.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  10.  */
  11. class CustomerBilling extends BaseEntity
  12. {
  13.     use SoftDeleteableEntity;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=State::class, inversedBy="customerBillings")
  22.      */
  23.     private $state;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=City::class, inversedBy="customerBillings")
  26.      */
  27.     private $city;
  28.     /**
  29.      * @ORM\ManyToOne(targetEntity=Country::class, inversedBy="customerBillings")
  30.      */
  31.     private $country;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $address;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $zipCode;
  40.     /**
  41.      * @ORM\OneToOne(targetEntity=User::class, mappedBy="customerBilling", cascade={"persist", "remove"})
  42.      */
  43.     private $user;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getState(): ?State
  49.     {
  50.         return $this->state;
  51.     }
  52.     public function setState(?State $state): self
  53.     {
  54.         $this->state $state;
  55.         return $this;
  56.     }
  57.     public function getCity(): ?City
  58.     {
  59.         return $this->city;
  60.     }
  61.     public function setCity(?City $city): self
  62.     {
  63.         $this->city $city;
  64.         return $this;
  65.     }
  66.     public function getCountry(): ?Country
  67.     {
  68.         return $this->country;
  69.     }
  70.     public function setCountry(?Country $country): self
  71.     {
  72.         $this->country $country;
  73.         return $this;
  74.     }
  75.     public function getAddress(): ?string
  76.     {
  77.         return $this->address;
  78.     }
  79.     public function setAddress(?string $address): self
  80.     {
  81.         $this->address $address;
  82.         return $this;
  83.     }
  84.     public function getZipCode(): ?string
  85.     {
  86.         return $this->zipCode;
  87.     }
  88.     public function setZipCode(?string $zipCode): self
  89.     {
  90.         $this->zipCode $zipCode;
  91.         return $this;
  92.     }
  93.     public function getUser(): ?User
  94.     {
  95.         return $this->user;
  96.     }
  97.     public function setUser(?User $user): self
  98.     {
  99.         // unset the owning side of the relation if necessary
  100.         if ($user === null && $this->user !== null) {
  101.             $this->user->setCustomerBilling(null);
  102.         }
  103.         // set the owning side of the relation if necessary
  104.         if ($user !== null && $user->getCustomerBilling() !== $this) {
  105.             $user->setCustomerBilling($this);
  106.         }
  107.         $this->user $user;
  108.         return $this;
  109.     }
  110. }