<?php
namespace App\Entity;
use App\Repository\OrderBillingDetailsRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrderBillingDetailsRepository::class)]
class OrderBillingDetails
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $street;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $suburb;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $state;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $country;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $postcode;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $firstName;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $lastName;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $organisation;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $phoneNumber;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $emailAddress;
#[ORM\OneToOne(mappedBy: 'orderBillingDetails', targetEntity: OrderDetails::class, cascade: ['persist', 'remove'])]
private $orderDetails;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $payframeToken;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $payframeKey;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $cardId;
#[ORM\Column(type: 'boolean', nullable: true)]
private $isSavedCreditCard;
#[ORM\Column(length: 255, nullable: true)]
private ?string $abn = null;
public function getId(): ?int
{
return $this->id;
}
public function getStreet(): ?string
{
return $this->street;
}
public function setStreet(?string $street): self
{
$this->street = $street;
return $this;
}
public function getSuburb(): ?string
{
return $this->suburb;
}
public function setSuburb(?string $suburb): self
{
$this->suburb = $suburb;
return $this;
}
public function getState(): ?string
{
return $this->state;
}
public function setState(?string $state): self
{
$this->state = $state;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): self
{
$this->country = $country;
return $this;
}
public function getPostcode(): ?string
{
return $this->postcode;
}
public function setPostcode(?string $postcode): self
{
$this->postcode = $postcode;
return $this;
}
public function getFirstName(): ?string
{
return $this->firstName;
}
public function setFirstName(?string $firstName): self
{
$this->firstName = $firstName;
return $this;
}
public function getLastName(): ?string
{
return $this->lastName;
}
public function setLastName(?string $lastName): self
{
$this->lastName = $lastName;
return $this;
}
public function getOrganisation(): ?string
{
return $this->organisation;
}
public function setOrganisation(?string $organisation): self
{
$this->organisation = $organisation;
return $this;
}
public function getPhoneNumber(): ?string
{
return $this->phoneNumber;
}
public function setPhoneNumber(?string $phoneNumber): self
{
$this->phoneNumber = $phoneNumber;
return $this;
}
public function getEmailAddress(): ?string
{
return $this->emailAddress;
}
public function setEmailAddress(?string $emailAddress): self
{
$this->emailAddress = $emailAddress;
return $this;
}
public function getOrderDetails(): ?OrderDetails
{
return $this->orderDetails;
}
public function setOrderDetails(?OrderDetails $orderDetails): self
{
// unset the owning side of the relation if necessary
if ($orderDetails === null && $this->orderDetails !== null) {
$this->orderDetails->setOrderBillingDetails(null);
}
// set the owning side of the relation if necessary
if ($orderDetails !== null && $orderDetails->getOrderBillingDetails() !== $this) {
$orderDetails->setOrderBillingDetails($this);
}
$this->orderDetails = $orderDetails;
return $this;
}
public function getFullName(): string
{
$string = 'Anonymous';
if ($this->firstName && empty($this->lastName)) {
$string = $this->firstName;
}
if (empty($this->firstName) && $this->lastName) {
$string = $this->lastName;
}
if ($this->firstName && $this->lastName) {
$string = sprintf('%s %s', $this->firstName, $this->lastName);
}
return $string;
}
public function getPayframeToken(): ?string
{
return $this->payframeToken;
}
public function setPayframeToken(?string $payframeToken): self
{
$this->payframeToken = $payframeToken;
return $this;
}
public function getPayframeKey(): ?string
{
return $this->payframeKey;
}
public function setPayframeKey(?string $payframeKey): self
{
$this->payframeKey = $payframeKey;
return $this;
}
public function getCardId(): ?string
{
return $this->cardId;
}
public function setCardId(?string $cardId): self
{
$this->cardId = $cardId;
return $this;
}
public function isIsSavedCreditCard(): ?bool
{
return $this->isSavedCreditCard;
}
public function setIsSavedCreditCard(?bool $isSavedCreditCard): self
{
$this->isSavedCreditCard = $isSavedCreditCard;
return $this;
}
public function getSavedCreditCardNumber(): int
{
if ($this->isSavedCreditCard) {
return 1;
}
return 0;
}
public function getAbn(): ?string
{
return $this->abn;
}
public function setAbn(?string $abn): self
{
$this->abn = $abn;
return $this;
}
}