src/Entity/FilmProject.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FilmProjectRepository;
  4. use App\String\Constant;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation\Exclude;
  9. use JMS\Serializer\Annotation\MaxDepth;
  10. #[ORM\Entity(repositoryClassFilmProjectRepository::class)]
  11. class FilmProject
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[MaxDepth(1)]
  18.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectMember::class, cascade: ['persist''remove'])]
  19.     private $filmProjectMembers;
  20.     #[MaxDepth(1)]
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private $title;
  23.     #[MaxDepth(1)]
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $productionStage;
  26.     #[MaxDepth(1)]
  27.     #[ORM\Column(type'string'length255nullabletrue)]
  28.     private $productionType;
  29.     #[MaxDepth(1)]
  30.     #[ORM\OneToOne(mappedBy'filmProject'targetEntityFilmProjectDetails::class, cascade: ['persist''remove'])]
  31.     private $filmProjectDetails;
  32.     #[MaxDepth(1)]
  33.     #[ORM\OneToOne(mappedBy'filmProject'targetEntityFilmProjectStoryImpact::class, cascade: ['persist''remove'])]
  34.     private $filmProjectStoryImpact;
  35.     #[MaxDepth(1)]
  36.     #[ORM\OneToOne(mappedBy'filmProject'targetEntityFilmProjectTimeline::class, cascade: ['persist''remove'])]
  37.     private $filmProjectTimeline;
  38.     #[MaxDepth(1)]
  39.     #[ORM\OneToOne(mappedBy'filmProject'targetEntityFilmProjectFunding::class, cascade: ['persist''remove'])]
  40.     private $filmProjectFunding;
  41.     #[MaxDepth(1)]
  42.     #[ORM\Column(type'string'length255)]
  43.     private $status;
  44.     #[MaxDepth(1)]
  45.     #[Exclude()]
  46.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'filmProjects')]
  47.     private $owner;
  48.     #[MaxDepth(1)]
  49.     #[Exclude()]
  50.     #[ORM\OneToOne(targetEntityOrderDetails::class, cascade: ['persist''remove'])]
  51.     private $orderDetails;
  52.     #[MaxDepth(1)]
  53.     #[ORM\OneToOne(targetEntityFilmProjectMember::class, cascade: ['persist''remove'] )]
  54.     private $filmProjectAdmin;
  55.     #[MaxDepth(1)]
  56.     #[ORM\OneToOne(targetEntityFilmProjectMember::class, cascade: ['persist''remove'])]
  57.     private $filmProjectProducer;
  58.     #[MaxDepth(1)]
  59.     #[ORM\OneToOne(targetEntityFilmProjectMember::class, cascade: ['persist''remove'])]
  60.     private $filmProjectDirector;
  61.     #[MaxDepth(1)]
  62.     #[ORM\Column(type'integer'nullabletrue)]
  63.     private $wordpressId;
  64.     #[MaxDepth(1)]
  65.     #[ORM\Column(length255nullabletrue)]
  66.     private ?string $wordpressStatus null;
  67.     #[MaxDepth(1)]
  68.     #[ORM\Column(type'string'length255nullabletrue)]
  69.     private $salesforceId;
  70.     #[MaxDepth(1)]
  71.     #[ORM\Column(type'text'nullabletrue)]
  72.     private $note;
  73.     #[MaxDepth(1)]
  74.     #[ORM\Column(type'integer'nullabletrue)]
  75.     private $resubmitCount;
  76.     #[MaxDepth(1)]
  77.     #[ORM\ManyToOne(targetEntityProduct::class, inversedBy'filmProjects')]
  78.     private $product;
  79.     #[MaxDepth(1)]
  80.     #[ORM\Column(type'datetime'nullabletrue)]
  81.     private $createdAt;
  82.     #[MaxDepth(1)]
  83.     #[ORM\Column(type'datetime'nullabletrue)]
  84.     private $modifiedAt;
  85.     #[MaxDepth(1)]
  86.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityDonation::class, cascade: ['persist''remove'])]
  87.     private $donations;
  88.     #[MaxDepth(1)]
  89.     #[ORM\Column(type'float'nullabletrue)]
  90.     private $totalDonation;
  91.     #[MaxDepth(1)]
  92.     #[ORM\Column(type'string'length255nullabletrue)]
  93.     private $trackingOptionId;
  94.     #[Exclude()]
  95.     #[ORM\OneToOne(mappedBy'filmProject'targetEntityFilmProjectOriginal::class, cascade: ['persist''remove'])]
  96.     private $filmProjectOriginal;
  97.     #[Exclude()]
  98.     #[ORM\ManyToMany(targetEntityUser::class, mappedBy'followedFilmProjects')]
  99.     private $users;
  100.     #[Exclude()]
  101.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectUpdate::class, cascade: ['persist''remove'])]
  102.     private Collection $filmProjectUpdates;
  103.     #[Exclude()]
  104.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectImage::class, cascade: ['persist''remove'])]
  105.     private Collection $filmProjectImages;
  106.     #[Exclude()]
  107.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectSponsor::class, cascade: ['persist''remove'])]
  108.     private Collection $filmProjectSponsors;
  109.     #[ORM\Column(nullabletrue)]
  110.     private ?int $tabActive null;
  111.     #[ORM\Column(nullabletrue)]
  112.     private ?bool $isHideDonationBox null;
  113.     #[ORM\Column(length255nullabletrue)]
  114.     private ?string $wordpressPassword null;
  115.     #[ORM\Column(nullabletrue)]
  116.     private ?int $oldWordpressId null;
  117.     #[ORM\Column(nullabletrue)]
  118.     private ?bool $isDafCore null;
  119.     #[ORM\Column(nullabletrue)]
  120.     private ?bool $isDafProgram null;
  121.     #[ORM\Column(length255nullabletrue)]
  122.     private ?string $xeroId null;
  123.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectChangeHistory::class)]
  124.     private Collection $filmProjectChangeHistories;
  125.     #[ORM\OneToMany(mappedBy'filmProject'targetEntityFilmProjectProgressReport::class)]
  126.     private Collection $filmProjectProgressReports;
  127.     #[ORM\ManyToOne(inversedBy'recurringFilmProjects')]
  128.     private ?Product $recurringProduct null;
  129.     #[ORM\Column(nullabletrue)]
  130.     private ?bool $isProgressReportActive null;
  131.     public function __construct()
  132.     {
  133.         $this->filmProjectMembers = new ArrayCollection();
  134.         $this->donations = new ArrayCollection();
  135.         $this->users = new ArrayCollection();
  136.         $this->filmProjectUpdates = new ArrayCollection();
  137.         $this->filmProjectImages = new ArrayCollection();
  138.         $this->filmProjectSponsors = new ArrayCollection();
  139.         $this->filmProjectChangeHistories = new ArrayCollection();
  140.         $this->filmProjectProgressReports = new ArrayCollection();
  141.     }
  142.     public function getId(): ?int
  143.     {
  144.         return $this->id;
  145.     }
  146.     /**
  147.      * @return Collection<int, FilmProjectMember>
  148.      */
  149.     public function getFilmProjectMembers(): Collection
  150.     {
  151.         return $this->filmProjectMembers;
  152.     }
  153.     public function addFilmProjectMember(FilmProjectMember $filmProjectMember): self
  154.     {
  155.         if (!$this->filmProjectMembers->contains($filmProjectMember)) {
  156.             $this->filmProjectMembers[] = $filmProjectMember;
  157.             $filmProjectMember->setFilmProject($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeFilmProjectMember(FilmProjectMember $filmProjectMember): self
  162.     {
  163.         if ($this->filmProjectMembers->removeElement($filmProjectMember)) {
  164.             // set the owning side to null (unless already changed)
  165.             if ($filmProjectMember->getFilmProject() === $this) {
  166.                 $filmProjectMember->setFilmProject(null);
  167.             }
  168.         }
  169.         return $this;
  170.     }
  171.     public function getTitle(): ?string
  172.     {
  173.         return $this->title;
  174.     }
  175.     public function setTitle(?string $title): self
  176.     {
  177.         $this->title $title;
  178.         return $this;
  179.     }
  180.     public function getProductionStage(): ?string
  181.     {
  182.         return $this->productionStage;
  183.     }
  184.     public function setProductionStage(?string $productionStage): self
  185.     {
  186.         $this->productionStage $productionStage;
  187.         return $this;
  188.     }
  189.     public function getProductionStageWordpress(): ?string
  190.     {
  191.         if ($this->productionStage == 'Post-Production') {
  192.             return 'Post-production';
  193.         } elseif ($this->productionStage == 'Film Complete') {
  194.             return 'Film Completed';
  195.         }
  196.         return $this->productionStage;
  197.     }
  198.     public function getProductionType(): ?string
  199.     {
  200.         return $this->productionType;
  201.     }
  202.     public function setProductionType(?string $productionType): self
  203.     {
  204.         $this->productionType $productionType;
  205.         return $this;
  206.     }
  207.     public function getFilmProjectDetails(): ?FilmProjectDetails
  208.     {
  209.         return $this->filmProjectDetails;
  210.     }
  211.     public function setFilmProjectDetails(?FilmProjectDetails $filmProjectDetails): self
  212.     {
  213.         // unset the owning side of the relation if necessary
  214.         if ($filmProjectDetails === null && $this->filmProjectDetails !== null) {
  215.             $this->filmProjectDetails->setFilmProject(null);
  216.         }
  217.         // set the owning side of the relation if necessary
  218.         if ($filmProjectDetails !== null && $filmProjectDetails->getFilmProject() !== $this) {
  219.             $filmProjectDetails->setFilmProject($this);
  220.         }
  221.         $this->filmProjectDetails $filmProjectDetails;
  222.         return $this;
  223.     }
  224.     public function getFilmProjectStoryImpact(): ?FilmProjectStoryImpact
  225.     {
  226.         return $this->filmProjectStoryImpact;
  227.     }
  228.     public function setFilmProjectStoryImpact(?FilmProjectStoryImpact $filmProjectStoryImpact): self
  229.     {
  230.         // unset the owning side of the relation if necessary
  231.         if ($filmProjectStoryImpact === null && $this->filmProjectStoryImpact !== null) {
  232.             $this->filmProjectStoryImpact->setFilmProject(null);
  233.         }
  234.         // set the owning side of the relation if necessary
  235.         if ($filmProjectStoryImpact !== null && $filmProjectStoryImpact->getFilmProject() !== $this) {
  236.             $filmProjectStoryImpact->setFilmProject($this);
  237.         }
  238.         $this->filmProjectStoryImpact $filmProjectStoryImpact;
  239.         return $this;
  240.     }
  241.     public function getFilmProjectTimeline(): ?FilmProjectTimeline
  242.     {
  243.         return $this->filmProjectTimeline;
  244.     }
  245.     public function setFilmProjectTimeline(?FilmProjectTimeline $filmProjectTimeline): self
  246.     {
  247.         // unset the owning side of the relation if necessary
  248.         if ($filmProjectTimeline === null && $this->filmProjectTimeline !== null) {
  249.             $this->filmProjectTimeline->setFilmProject(null);
  250.         }
  251.         // set the owning side of the relation if necessary
  252.         if ($filmProjectTimeline !== null && $filmProjectTimeline->getFilmProject() !== $this) {
  253.             $filmProjectTimeline->setFilmProject($this);
  254.         }
  255.         $this->filmProjectTimeline $filmProjectTimeline;
  256.         return $this;
  257.     }
  258.     public function getFilmProjectFunding(): ?FilmProjectFunding
  259.     {
  260.         return $this->filmProjectFunding;
  261.     }
  262.     public function setFilmProjectFunding(?FilmProjectFunding $filmProjectFunding): self
  263.     {
  264.         // unset the owning side of the relation if necessary
  265.         if ($filmProjectFunding === null && $this->filmProjectFunding !== null) {
  266.             $this->filmProjectFunding->setFilmProject(null);
  267.         }
  268.         // set the owning side of the relation if necessary
  269.         if ($filmProjectFunding !== null && $filmProjectFunding->getFilmProject() !== $this) {
  270.             $filmProjectFunding->setFilmProject($this);
  271.         }
  272.         $this->filmProjectFunding $filmProjectFunding;
  273.         return $this;
  274.     }
  275.     public function getStatus(): ?string
  276.     {
  277.         return $this->status;
  278.     }
  279.     public function setStatus(string $status): self
  280.     {
  281.         $this->status $status;
  282.         return $this;
  283.     }
  284.     public function getOwner(): ?User
  285.     {
  286.         return $this->owner;
  287.     }
  288.     public function setOwner(?User $owner): self
  289.     {
  290.         $this->owner $owner;
  291.         return $this;
  292.     }
  293.     public function getOrder()
  294.     {
  295.         return 'not set';
  296.     }
  297.     public function getOrderDetails(): ?OrderDetails
  298.     {
  299.         return $this->orderDetails;
  300.     }
  301.     public function setOrderDetails(?OrderDetails $orderDetails): self
  302.     {
  303.         $this->orderDetails $orderDetails;
  304.         return $this;
  305.     }
  306.     public function getFilmProjectAdmin(): ?FilmProjectMember
  307.     {
  308.         return $this->filmProjectAdmin;
  309.     }
  310.     public function setFilmProjectAdmin(?FilmProjectMember $filmProjectAdmin): self
  311.     {
  312.         $this->filmProjectAdmin $filmProjectAdmin;
  313.         return $this;
  314.     }
  315.     public function getFilmProjectProducer(): ?FilmProjectMember
  316.     {
  317.         return $this->filmProjectProducer;
  318.     }
  319.     public function setFilmProjectProducer(?FilmProjectMember $filmProjectProducer): self
  320.     {
  321.         $this->filmProjectProducer $filmProjectProducer;
  322.         return $this;
  323.     }
  324.     public function getFilmProjectDirector(): ?FilmProjectMember
  325.     {
  326.         return $this->filmProjectDirector;
  327.     }
  328.     public function setFilmProjectDirector(?FilmProjectMember $filmProjectDirector): self
  329.     {
  330.         $this->filmProjectDirector $filmProjectDirector;
  331.         return $this;
  332.     }
  333.     public function getWordpressId(): ?int
  334.     {
  335.         return $this->wordpressId;
  336.     }
  337.     public function setWordpressId(?int $wordpressId): self
  338.     {
  339.         $this->wordpressId $wordpressId;
  340.         return $this;
  341.     }
  342.     public function getSalesforceId(): ?string
  343.     {
  344.         return $this->salesforceId;
  345.     }
  346.     public function setSalesforceId(?string $salesforceId): self
  347.     {
  348.         $this->salesforceId $salesforceId;
  349.         return $this;
  350.     }
  351.     public function getNote(): ?string
  352.     {
  353.         return $this->note;
  354.     }
  355.     public function setNote(?string $note): self
  356.     {
  357.         $this->note $note;
  358.         return $this;
  359.     }
  360.     public function getResubmitCount(): ?int
  361.     {
  362.         return $this->resubmitCount;
  363.     }
  364.     public function setResubmitCount(?int $resubmitCount): self
  365.     {
  366.         $this->resubmitCount $resubmitCount;
  367.         return $this;
  368.     }
  369.     public function getProduct(): ?Product
  370.     {
  371.         return $this->product;
  372.     }
  373.     public function setProduct(?Product $product): self
  374.     {
  375.         $this->product $product;
  376.         return $this;
  377.     }
  378.     public function getCreatedAt(): ?\DateTimeInterface
  379.     {
  380.         return $this->createdAt;
  381.     }
  382.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  383.     {
  384.         $this->createdAt $createdAt;
  385.         return $this;
  386.     }
  387.     public function getModifiedAt(): ?\DateTimeInterface
  388.     {
  389.         return $this->modifiedAt;
  390.     }
  391.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  392.     {
  393.         $this->modifiedAt $modifiedAt;
  394.         return $this;
  395.     }
  396.     /**
  397.      * @return Collection<int, Donation>
  398.      */
  399.     public function getDonations(): Collection
  400.     {
  401.         return $this->donations;
  402.     }
  403.     public function addDonation(Donation $donation): self
  404.     {
  405.         if (!$this->donations->contains($donation)) {
  406.             $this->donations[] = $donation;
  407.             $donation->setFilmProject($this);
  408.         }
  409.         return $this;
  410.     }
  411.     public function removeDonation(Donation $donation): self
  412.     {
  413.         if ($this->donations->removeElement($donation)) {
  414.             // set the owning side to null (unless already changed)
  415.             if ($donation->getFilmProject() === $this) {
  416.                 $donation->setFilmProject(null);
  417.             }
  418.         }
  419.         return $this;
  420.     }    
  421.     
  422.     public function getTotalDonation(): ?float
  423.     {
  424.         return $this->totalDonation;
  425.     }
  426.     public function setTotalDonation(?float $totalDonation): self
  427.     {
  428.         $this->totalDonation $totalDonation;
  429.         return $this;
  430.     }
  431.     // Add other functionalities below
  432.     public function addTotalDonation(float $amount): self
  433.     {
  434.         $this->totalDonation += $amount;
  435.         return $this;
  436.     }
  437.     public function reduceTotalDonation(float $amount): self
  438.     {
  439.         $this->totalDonation -= $amount;
  440.         return $this;
  441.     }
  442.     public function toString()
  443.     {
  444.         if ($this->title) {
  445.             return $this->title;
  446.         }
  447.         return '';
  448.     }
  449.     public function __toString()
  450.     {
  451.         return $this->toString();
  452.     }
  453.     public function getTrackingOptionId(): ?string
  454.     {
  455.         return $this->trackingOptionId;
  456.     }
  457.     public function setTrackingOptionId(?string $trackingOptionId): self
  458.     {
  459.         $this->trackingOptionId $trackingOptionId;
  460.         return $this;
  461.     }
  462.     public function getFilmProjectOriginal(): ?FilmProjectOriginal
  463.     {
  464.         return $this->filmProjectOriginal;
  465.     }
  466.     public function setFilmProjectOriginal(?FilmProjectOriginal $filmProjectOriginal): self
  467.     {
  468.         // unset the owning side of the relation if necessary
  469.         if ($filmProjectOriginal === null && $this->filmProjectOriginal !== null) {
  470.             $this->filmProjectOriginal->setFilmProject(null);
  471.         }
  472.         // set the owning side of the relation if necessary
  473.         if ($filmProjectOriginal !== null && $filmProjectOriginal->getFilmProject() !== $this) {
  474.             $filmProjectOriginal->setFilmProject($this);
  475.         }
  476.         $this->filmProjectOriginal $filmProjectOriginal;
  477.         return $this;
  478.     }
  479.     /**
  480.      * @return Collection<int, User>
  481.      */
  482.     public function getUsers(): Collection
  483.     {
  484.         return $this->users;
  485.     }
  486.     public function addUser(User $user): self
  487.     {
  488.         if (!$this->users->contains($user)) {
  489.             $this->users[] = $user;
  490.             $user->addFollowedFilmProject($this);
  491.         }
  492.         return $this;
  493.     }
  494.     public function removeUser(User $user): self
  495.     {
  496.         if ($this->users->removeElement($user)) {
  497.             $user->removeFollowedFilmProject($this);
  498.         }
  499.         return $this;
  500.     }
  501.     /**
  502.      * @return Collection<int, FilmProjectUpdate>
  503.      */
  504.     public function getFilmProjectUpdates(): Collection
  505.     {
  506.         return $this->filmProjectUpdates;
  507.     }
  508.     public function addFilmProjectUpdate(FilmProjectUpdate $filmProjectUpdate): self
  509.     {
  510.         if (!$this->filmProjectUpdates->contains($filmProjectUpdate)) {
  511.             $this->filmProjectUpdates->add($filmProjectUpdate);
  512.             $filmProjectUpdate->setFilmProject($this);
  513.         }
  514.         return $this;
  515.     }
  516.     public function removeFilmProjectUpdate(FilmProjectUpdate $filmProjectUpdate): self
  517.     {
  518.         if ($this->filmProjectUpdates->removeElement($filmProjectUpdate)) {
  519.             // set the owning side to null (unless already changed)
  520.             if ($filmProjectUpdate->getFilmProject() === $this) {
  521.                 $filmProjectUpdate->setFilmProject(null);
  522.             }
  523.         }
  524.         return $this;
  525.     }
  526.     public function getWordpressUrl(): string
  527.     {
  528.         $url '';
  529.         if ($this->wordpressId) {
  530.             $url Constant::WORDPRESS_URL '?page_id='$this->wordpressId;
  531.         }
  532.         return $url;
  533.     }
  534.     public function getWordpressDraftUrl(): string
  535.     {
  536.         $url '';
  537.         if ($this->wordpressId) {
  538.             $url Constant::WORDPRESS_URL '/admin-dashboard?redirect_to='urlencode("/?post_type=project&p="). $this->wordpressId;
  539.         }
  540.         return $url;
  541.     }
  542.     public function getFundingStatus(): string
  543.     {
  544.         $fundingStatus '-';
  545.         $currentFunding 0;
  546.         if ($this->totalDonation) {
  547.             $currentFunding '$'number_format($this->totalDonation 1002'.'',');
  548.         }
  549.         if ($this->filmProjectFunding) {
  550.             if ($this->filmProjectFunding->getFundraisingGoal()) {
  551.                 $goal $this->filmProjectFunding->getFundraisingGoal() / 100;
  552.                 $goal '$'number_format($goal2'.'',');
  553.                 $fundingStatus $currentFunding .' / '$goal;
  554.             } else {
  555.                 return $fundingStatus;
  556.             }
  557.         }
  558.         return $fundingStatus;
  559.     }
  560.     public function getWordpressStatus(): ?string
  561.     {
  562.         return $this->wordpressStatus;
  563.     }
  564.     public function setWordpressStatus(?string $wordpressStatus): self
  565.     {
  566.         $this->wordpressStatus $wordpressStatus;
  567.         return $this;
  568.     }
  569.     public function teamMemberRole()
  570.     {
  571.         $role 'testing';
  572.         return $role;
  573.     }
  574.     /**
  575.      * @return Collection<int, FilmProjectImage>
  576.      */
  577.     public function getFilmProjectImages(): Collection
  578.     {
  579.         return $this->filmProjectImages;
  580.     }
  581.     public function addFilmProjectImage(FilmProjectImage $filmProjectImage): self
  582.     {
  583.         if (!$this->filmProjectImages->contains($filmProjectImage)) {
  584.             $this->filmProjectImages->add($filmProjectImage);
  585.             $filmProjectImage->setFilmProject($this);
  586.         }
  587.         return $this;
  588.     }
  589.     public function removeFilmProjectImage(FilmProjectImage $filmProjectImage): self
  590.     {
  591.         if ($this->filmProjectImages->removeElement($filmProjectImage)) {
  592.             // set the owning side to null (unless already changed)
  593.             if ($filmProjectImage->getFilmProject() === $this) {
  594.                 $filmProjectImage->setFilmProject(null);
  595.             }
  596.         }
  597.         return $this;
  598.     }
  599.     /**
  600.      * @return Collection<int, FilmProjectSponsor>
  601.      */
  602.     public function getFilmProjectSponsors(): Collection
  603.     {
  604.         return $this->filmProjectSponsors;
  605.     }
  606.     public function addFilmProjectSponsor(FilmProjectSponsor $filmProjectSponsor): self
  607.     {
  608.         if (!$this->filmProjectSponsors->contains($filmProjectSponsor)) {
  609.             $this->filmProjectSponsors->add($filmProjectSponsor);
  610.             $filmProjectSponsor->setFilmProject($this);
  611.         }
  612.         return $this;
  613.     }
  614.     public function removeFilmProjectSponsor(FilmProjectSponsor $filmProjectSponsor): self
  615.     {
  616.         if ($this->filmProjectSponsors->removeElement($filmProjectSponsor)) {
  617.             // set the owning side to null (unless already changed)
  618.             if ($filmProjectSponsor->getFilmProject() === $this) {
  619.                 $filmProjectSponsor->setFilmProject(null);
  620.             }
  621.         }
  622.         return $this;
  623.     }
  624.     /**
  625.      * Returning all project team members
  626.      *
  627.      * @return array
  628.      */
  629.     public function getAllMembers(): array
  630.     {
  631.         $filmProjectTeam = [];
  632.         $filmAdmin $this->getFilmProjectAdmin();
  633.         $filmProducer $this->getFilmProjectProducer();
  634.         $filmDirector $this->getFilmProjectDirector();
  635.         $filmProjectTeam = [$filmAdmin$filmProducer$filmDirector];
  636.         foreach($this->getFilmProjectMembers() as $filmProjectMember) {
  637.             array_push($filmProjectTeam$filmProjectMember);
  638.         }
  639.         return $filmProjectTeam;
  640.     }
  641.     public function getTabActive(): ?int
  642.     {
  643.         return $this->tabActive;
  644.     }
  645.     public function setTabActive(?int $tabActive): self
  646.     {
  647.         $this->tabActive $tabActive;
  648.         return $this;
  649.     }
  650.     public function isIsHideDonationBox(): ?bool
  651.     {
  652.         return $this->isHideDonationBox;
  653.     }
  654.     public function setIsHideDonationBox(?bool $isHideDonationBox): self
  655.     {
  656.         $this->isHideDonationBox $isHideDonationBox;
  657.         return $this;
  658.     }
  659.     
  660.     public function getWordpressPassword(): ?string
  661.     {
  662.         return $this->wordpressPassword;
  663.     }
  664.     public function setWordpressPassword(?string $wordpressPassword): self
  665.     {
  666.         $this->wordpressPassword $wordpressPassword;
  667.         return $this;
  668.     }
  669.     public function getOldWordpressId(): ?int
  670.     {
  671.         return $this->oldWordpressId;
  672.     }
  673.     public function setOldWordpressId(?int $oldWordpressId): self
  674.     {
  675.         $this->oldWordpressId $oldWordpressId;
  676.         return $this;
  677.     }
  678.     public function isIsDafCore(): ?bool
  679.     {
  680.         return $this->isDafCore;
  681.     }
  682.     public function setIsDafCore(?bool $isDafCore): self
  683.     {
  684.         $this->isDafCore $isDafCore;
  685.         return $this;
  686.     }
  687.     public function isIsDafProgram(): ?bool
  688.     {
  689.         return $this->isDafProgram;
  690.     }
  691.     public function setIsDafProgram(?bool $isDafProgram): self
  692.     {
  693.         $this->isDafProgram $isDafProgram;
  694.         return $this;
  695.     }
  696.     public function getXeroId(): ?string
  697.     {
  698.         return $this->xeroId;
  699.     }
  700.     public function setXeroId(?string $xeroId): static
  701.     {
  702.         $this->xeroId $xeroId;
  703.         return $this;
  704.     }
  705.     /**
  706.      * @return Collection<int, FilmProjectChangeHistory>
  707.      */
  708.     public function getFilmProjectChangeHistories(): Collection
  709.     {
  710.         return $this->filmProjectChangeHistories;
  711.     }
  712.     public function addFilmProjectChangeHistory(FilmProjectChangeHistory $filmProjectChangeHistory): static
  713.     {
  714.         if (!$this->filmProjectChangeHistories->contains($filmProjectChangeHistory)) {
  715.             $this->filmProjectChangeHistories->add($filmProjectChangeHistory);
  716.             $filmProjectChangeHistory->setFilmProject($this);
  717.         }
  718.         return $this;
  719.     }
  720.     public function removeFilmProjectChangeHistory(FilmProjectChangeHistory $filmProjectChangeHistory): static
  721.     {
  722.         if ($this->filmProjectChangeHistories->removeElement($filmProjectChangeHistory)) {
  723.             // set the owning side to null (unless already changed)
  724.             if ($filmProjectChangeHistory->getFilmProject() === $this) {
  725.                 $filmProjectChangeHistory->setFilmProject(null);
  726.             }
  727.         }
  728.         return $this;
  729.     }
  730.     /**
  731.      * @return Collection<int, FilmProjectProgressReport>
  732.      */
  733.     public function getFilmProjectProgressReports(): Collection
  734.     {
  735.         return $this->filmProjectProgressReports;
  736.     }
  737.     public function addFilmProjectProgressReport(FilmProjectProgressReport $filmProjectProgressReport): static
  738.     {
  739.         if (!$this->filmProjectProgressReports->contains($filmProjectProgressReport)) {
  740.             $this->filmProjectProgressReports->add($filmProjectProgressReport);
  741.             $filmProjectProgressReport->setFilmProject($this);
  742.         }
  743.         return $this;
  744.     }
  745.     public function removeFilmProjectProgressReport(FilmProjectProgressReport $filmProjectProgressReport): static
  746.     {
  747.         if ($this->filmProjectProgressReports->removeElement($filmProjectProgressReport)) {
  748.             // set the owning side to null (unless already changed)
  749.             if ($filmProjectProgressReport->getFilmProject() === $this) {
  750.                 $filmProjectProgressReport->setFilmProject(null);
  751.             }
  752.         }
  753.         return $this;
  754.     }
  755.     public function getProgressReportStatus() {
  756.         $progressReports $this->filmProjectProgressReports;
  757.         $currentYear = (int) date('Y');
  758.         foreach ($progressReports as $progressReport) {
  759.             $progressReportYear = (int) ($progressReport->getCreatedAt())->format('Y');
  760.             if ($currentYear === $progressReportYear && $progressReport->getStatus() == 'completed') {
  761.                 return true;
  762.             }
  763.         }
  764.         return false;
  765.     }
  766.     public function getProgressReportStatusUpdate() {
  767.         $progressReports $this->filmProjectProgressReports;
  768.         $currentYear = (int) date('Y');
  769.         if ($progressReports->isEmpty()) {
  770.             return 'not_available';
  771.         }
  772.         foreach ($progressReports as $progressReport) {
  773.             $progressReportYear = (int) ($progressReport->getCreatedAt())->format('Y');
  774.             if ($currentYear === $progressReportYear && $progressReport->getStatus() != 'completed' && $progressReport->isIsDraft() ) {
  775.                 return 'in_progress';
  776.             }
  777.             if ($currentYear === $progressReportYear && $progressReport->getStatus() == 'completed') {
  778.                 return 'complete';
  779.             }
  780.         }
  781.         return 'not_complete';
  782.     }
  783.     public function getRecurringProduct(): ?Product
  784.     {
  785.         return $this->recurringProduct;
  786.     }
  787.     public function setRecurringProduct(?Product $recurringProduct): static
  788.     {
  789.         $this->recurringProduct $recurringProduct;
  790.         return $this;
  791.     }
  792.     public function getProgressReportUrl(): ?string
  793.     {
  794.         $currentYear = (int) date('Y');
  795.         $progressReportUrl '/progress-report/'$currentYear .'?projectId=' $this->id;
  796.         $html '<div class="d-flex align-items-center "><a href="'$progressReportUrl .'" target="_blank" class="btn btn-primary">View Progress Report</a></div>';
  797.         return $html;
  798.     }
  799.     public function isIsProgressReportActive(): ?bool
  800.     {
  801.         return $this->isProgressReportActive;
  802.     }
  803.     public function setIsProgressReportActive(?bool $isProgressReportActive): static
  804.     {
  805.         $this->isProgressReportActive $isProgressReportActive;
  806.         return $this;
  807.     }
  808. }