src/Entity/OrderBillingDetails.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\OrderBillingDetailsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassOrderBillingDetailsRepository::class)]
  6. class OrderBillingDetails
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255nullabletrue)]
  13.     private $street;
  14.     #[ORM\Column(type'string'length255nullabletrue)]
  15.     private $suburb;
  16.     #[ORM\Column(type'string'length255nullabletrue)]
  17.     private $state;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $country;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $postcode;
  22.     #[ORM\Column(type'string'length255nullabletrue)]
  23.     private $firstName;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $lastName;
  26.     #[ORM\Column(type'string'length255nullabletrue)]
  27.     private $organisation;
  28.     #[ORM\Column(type'string'length255nullabletrue)]
  29.     private $phoneNumber;
  30.     #[ORM\Column(type'string'length255nullabletrue)]
  31.     private $emailAddress;
  32.     #[ORM\OneToOne(mappedBy'orderBillingDetails'targetEntityOrderDetails::class, cascade: ['persist''remove'])]
  33.     private $orderDetails;
  34.     #[ORM\Column(type'string'length255nullabletrue)]
  35.     private $payframeToken;
  36.     #[ORM\Column(type'string'length255nullabletrue)]
  37.     private $payframeKey;
  38.     #[ORM\Column(type'string'length255nullabletrue)]
  39.     private $cardId;
  40.     #[ORM\Column(type'boolean'nullabletrue)]
  41.     private $isSavedCreditCard;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $abn null;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getStreet(): ?string
  49.     {
  50.         return $this->street;
  51.     }
  52.     public function setStreet(?string $street): self
  53.     {
  54.         $this->street $street;
  55.         return $this;
  56.     }
  57.     public function getSuburb(): ?string
  58.     {
  59.         return $this->suburb;
  60.     }
  61.     public function setSuburb(?string $suburb): self
  62.     {
  63.         $this->suburb $suburb;
  64.         return $this;
  65.     }
  66.     public function getState(): ?string
  67.     {
  68.         return $this->state;
  69.     }
  70.     public function setState(?string $state): self
  71.     {
  72.         $this->state $state;
  73.         return $this;
  74.     }
  75.     public function getCountry(): ?string
  76.     {
  77.         return $this->country;
  78.     }
  79.     public function setCountry(?string $country): self
  80.     {
  81.         $this->country $country;
  82.         return $this;
  83.     }
  84.     public function getPostcode(): ?string
  85.     {
  86.         return $this->postcode;
  87.     }
  88.     public function setPostcode(?string $postcode): self
  89.     {
  90.         $this->postcode $postcode;
  91.         return $this;
  92.     }
  93.     public function getFirstName(): ?string
  94.     {
  95.         return $this->firstName;
  96.     }
  97.     public function setFirstName(?string $firstName): self
  98.     {
  99.         $this->firstName $firstName;
  100.         return $this;
  101.     }
  102.     public function getLastName(): ?string
  103.     {
  104.         return $this->lastName;
  105.     }
  106.     public function setLastName(?string $lastName): self
  107.     {
  108.         $this->lastName $lastName;
  109.         return $this;
  110.     }
  111.     public function getOrganisation(): ?string
  112.     {
  113.         return $this->organisation;
  114.     }
  115.     public function setOrganisation(?string $organisation): self
  116.     {
  117.         $this->organisation $organisation;
  118.         return $this;
  119.     }
  120.     public function getPhoneNumber(): ?string
  121.     {
  122.         return $this->phoneNumber;
  123.     }
  124.     public function setPhoneNumber(?string $phoneNumber): self
  125.     {
  126.         $this->phoneNumber $phoneNumber;
  127.         return $this;
  128.     }
  129.     public function getEmailAddress(): ?string
  130.     {
  131.         return $this->emailAddress;
  132.     }
  133.     public function setEmailAddress(?string $emailAddress): self
  134.     {
  135.         $this->emailAddress $emailAddress;
  136.         return $this;
  137.     }
  138.     public function getOrderDetails(): ?OrderDetails
  139.     {
  140.         return $this->orderDetails;
  141.     }
  142.     public function setOrderDetails(?OrderDetails $orderDetails): self
  143.     {
  144.         // unset the owning side of the relation if necessary
  145.         if ($orderDetails === null && $this->orderDetails !== null) {
  146.             $this->orderDetails->setOrderBillingDetails(null);
  147.         }
  148.         // set the owning side of the relation if necessary
  149.         if ($orderDetails !== null && $orderDetails->getOrderBillingDetails() !== $this) {
  150.             $orderDetails->setOrderBillingDetails($this);
  151.         }
  152.         $this->orderDetails $orderDetails;
  153.         return $this;
  154.     }
  155.     public function getFullName(): string
  156.     {
  157.         $string 'Anonymous';
  158.         if ($this->firstName && empty($this->lastName)) {
  159.             $string $this->firstName;
  160.         }
  161.         if (empty($this->firstName) && $this->lastName) {
  162.             $string $this->lastName;
  163.         }
  164.         if ($this->firstName && $this->lastName) {
  165.             $string sprintf('%s %s'$this->firstName$this->lastName);
  166.         }
  167.         return $string;
  168.     }
  169.     public function getPayframeToken(): ?string
  170.     {
  171.         return $this->payframeToken;
  172.     }
  173.     public function setPayframeToken(?string $payframeToken): self
  174.     {
  175.         $this->payframeToken $payframeToken;
  176.         return $this;
  177.     }
  178.     public function getPayframeKey(): ?string
  179.     {
  180.         return $this->payframeKey;
  181.     }
  182.     public function setPayframeKey(?string $payframeKey): self
  183.     {
  184.         $this->payframeKey $payframeKey;
  185.         return $this;
  186.     }
  187.     public function getCardId(): ?string
  188.     {
  189.         return $this->cardId;
  190.     }
  191.     public function setCardId(?string $cardId): self
  192.     {
  193.         $this->cardId $cardId;
  194.         return $this;
  195.     }
  196.     public function isIsSavedCreditCard(): ?bool
  197.     {
  198.         return $this->isSavedCreditCard;
  199.     }
  200.     public function setIsSavedCreditCard(?bool $isSavedCreditCard): self
  201.     {
  202.         $this->isSavedCreditCard $isSavedCreditCard;
  203.         return $this;
  204.     }
  205.     public function getSavedCreditCardNumber(): int
  206.     {
  207.         if ($this->isSavedCreditCard) {
  208.             return 1;
  209.         }
  210.         return 0;
  211.     }
  212.     public function getAbn(): ?string
  213.     {
  214.         return $this->abn;
  215.     }
  216.     public function setAbn(?string $abn): self
  217.     {
  218.         $this->abn $abn;
  219.         return $this;
  220.     }
  221. }