src/Entity/Donation.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DonationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassDonationRepository::class)]
  6. class Donation
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityFilmProject::class, inversedBy'donations')]
  13.     private $filmProject;
  14.     #[ORM\OneToOne(targetEntityOrderDetails::class, cascade: ['persist''remove'])]
  15.     private $orderDetails;
  16.     #[ORM\Column(type'datetime'nullabletrue)]
  17.     private $createdAt;
  18.     #[ORM\Column(type'datetime'nullabletrue)]
  19.     private $modifiedAt;
  20.     #[ORM\Column(type'boolean'nullabletrue)]
  21.     private $isDonationEmail;
  22.     #[ORM\Column(type'boolean'nullabletrue)]
  23.     private $isOrganisationConsent;
  24.     #[ORM\Column(type'boolean'nullabletrue)]
  25.     private $isContactShared;
  26.     #[ORM\Column(type'boolean'nullabletrue)]
  27.     private $isNameApproved;
  28.     #[ORM\Column(type'boolean'nullabletrue)]
  29.     private $isRecurringDonation;
  30.     #[ORM\ManyToOne(targetEntityRecurringDonation::class, inversedBy'donations'cascade: ['persist''remove'])]
  31.     private $recurringDonation;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?float $supportdaf null;
  34.     #[ORM\Column(nullabletrue)]
  35.     private ?bool $isAmountInvisible null;
  36.     private $isTermsCondition;
  37.     private $isNonFamily;
  38.     #[ORM\Column(length255nullabletrue)]
  39.     private ?string $supportDafSalesforce null;
  40.     #[ORM\Column(nullabletrue)]
  41.     private ?bool $isDisplayOrganisation null;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $wordpressDonorName null;
  44.     public function getId(): ?int
  45.     {
  46.         return $this->id;
  47.     }
  48.     public function getFilmProject(): ?FilmProject
  49.     {
  50.         return $this->filmProject;
  51.     }
  52.     public function setFilmProject(?FilmProject $filmProject): self
  53.     {
  54.         $this->filmProject $filmProject;
  55.         return $this;
  56.     }
  57.     public function getOrderDetails(): ?OrderDetails
  58.     {
  59.         return $this->orderDetails;
  60.     }
  61.     public function setOrderDetails(?OrderDetails $orderDetails): self
  62.     {
  63.         $this->orderDetails $orderDetails;
  64.         return $this;
  65.     }
  66.     public function getCreatedAt(): ?\DateTimeInterface
  67.     {
  68.         return $this->createdAt;
  69.     }
  70.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  71.     {
  72.         $this->createdAt $createdAt;
  73.         return $this;
  74.     }
  75.     public function getModifiedAt(): ?\DateTimeInterface
  76.     {
  77.         return $this->modifiedAt;
  78.     }
  79.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  80.     {
  81.         $this->modifiedAt $modifiedAt;
  82.         return $this;
  83.     }
  84.     public function isIsDonationEmail(): ?bool
  85.     {
  86.         return $this->isDonationEmail;
  87.     }
  88.     public function setIsDonationEmail(?bool $isDonationEmail): self
  89.     {
  90.         $this->isDonationEmail $isDonationEmail;
  91.         return $this;
  92.     }
  93.     public function isIsOrganisationConsent(): ?bool
  94.     {
  95.         return $this->isOrganisationConsent;
  96.     }
  97.     public function setIsOrganisationConsent(?bool $isOrganisationConsent): self
  98.     {
  99.         $this->isOrganisationConsent $isOrganisationConsent;
  100.         return $this;
  101.     }
  102.     public function isIsContactShared(): ?bool
  103.     {
  104.         return $this->isContactShared;
  105.     }
  106.     public function setIsContactShared(?bool $isContactShared): self
  107.     {
  108.         $this->isContactShared $isContactShared;
  109.         return $this;
  110.     }
  111.     public function isIsNameApproved(): ?bool
  112.     {
  113.         return $this->isNameApproved;
  114.     }
  115.     public function setIsNameApproved(?bool $isNameApproved): self
  116.     {
  117.         $this->isNameApproved $isNameApproved;
  118.         return $this;
  119.     }
  120.     public function isIsRecurringDonation(): ?bool
  121.     {
  122.         return $this->isRecurringDonation;
  123.     }
  124.     public function setIsRecurringDonation(?bool $isRecurringDonation): self
  125.     {
  126.         $this->isRecurringDonation $isRecurringDonation;
  127.         return $this;
  128.     }
  129.     public function getRecurringDonation(): ?RecurringDonation
  130.     {
  131.         return $this->recurringDonation;
  132.     }
  133.     public function setRecurringDonation(?RecurringDonation $recurringDonation): self
  134.     {
  135.         $this->recurringDonation $recurringDonation;
  136.         return $this;
  137.     }
  138.     public function getSupportdaf(): ?float
  139.     {
  140.         return $this->supportdaf;
  141.     }
  142.     public function setSupportdaf(?float $supportdaf): self
  143.     {
  144.         $this->supportdaf $supportdaf;
  145.         return $this;
  146.     }
  147.     public function setAsNonAnonymous(): ?self
  148.     {
  149.         $this->isOrganisationConsent true;
  150.         return $this;
  151.     }
  152.     public function setAsAnonymous(): ?self
  153.     {
  154.         $this->isOrganisationConsent false;
  155.         return $this;
  156.     }
  157.     public function isIsAmountInvisible(): ?bool
  158.     {
  159.         return $this->isAmountInvisible;
  160.     }
  161.     public function setIsAmountInvisible(?bool $isAmountInvisible): self
  162.     {
  163.         $this->isAmountInvisible $isAmountInvisible;
  164.         return $this;
  165.     }
  166.     public function getIsTermsCondition()
  167.     {
  168.         return false;
  169.     }
  170.     public function getIsNonFamily()
  171.     {
  172.         return false;
  173.     }
  174.     public function getSupportDafSalesforce(): ?string
  175.     {
  176.         return $this->supportDafSalesforce;
  177.     }
  178.     public function setSupportDafSalesforce(?string $supportDafSalesforce): self
  179.     {
  180.         $this->supportDafSalesforce $supportDafSalesforce;
  181.         return $this;
  182.     }
  183.     public function getPopupAmount(): ?float
  184.     {
  185.         $finalAmount 0;
  186.         if ($this->orderDetails) {
  187.             $total = (float)$this->orderDetails->getTotal();
  188.             if ($this->supportdaf) {
  189.                $finalAmount $total - ((float)$this->supportdaf);
  190.             }
  191.         }
  192.         if ($finalAmount ) {
  193.             return $this->supportdaf;
  194.         }
  195.         return null;
  196.     }
  197.     public function isIsDisplayOrganisation(): ?bool
  198.     {
  199.         return $this->isDisplayOrganisation;
  200.     }
  201.     public function setIsDisplayOrganisation(?bool $isDisplayOrganisation): self
  202.     {
  203.         $this->isDisplayOrganisation $isDisplayOrganisation;
  204.         return $this;
  205.     }
  206.     public function getWordpressDonorName(): ?string
  207.     {
  208.         return $this->wordpressDonorName;
  209.     }
  210.     public function setWordpressDonorName(?string $wordpressDonorName): static
  211.     {
  212.         $this->wordpressDonorName $wordpressDonorName;
  213.         return $this;
  214.     }
  215. }