<?php
namespace Bidcoz\Bundle\CoreBundle\Entity;
use Bidcoz\Bundle\CoreBundle\Constants;
use Bidcoz\Bundle\CoreBundle\Entity\Auction\Auction;
use Bidcoz\Bundle\CoreBundle\Entity\Auction\BidNumber;
use Bidcoz\Bundle\CoreBundle\Entity\Auction\FundANeed;
use Bidcoz\Bundle\CoreBundle\Entity\Auction\Shop;
use Bidcoz\Bundle\CoreBundle\Entity\Contact\CampaignDetail;
use Bidcoz\Bundle\CoreBundle\Entity\Donation\CashDonation;
use Bidcoz\Bundle\CoreBundle\Entity\Donation\CryptoWallet;
use Bidcoz\Bundle\CoreBundle\Entity\Donation\DonationLevel;
use Bidcoz\Bundle\CoreBundle\Entity\Donation\MembershipLevel;
use Bidcoz\Bundle\CoreBundle\Entity\Procurement\Item;
use Bidcoz\Bundle\CoreBundle\Entity\Purchase\Donation\PaddleRaiseDonationPurchase;
use Bidcoz\Bundle\CoreBundle\Entity\Purchase\Purchase;
use Bidcoz\Bundle\CoreBundle\Entity\Raffle\RaffleType;
use Bidcoz\Bundle\CoreBundle\Entity\Registration\Registration;
use Bidcoz\Bundle\CoreBundle\Entity\Registration\RegistrationType;
use Bidcoz\Bundle\CoreBundle\Entity\Sponsorship\Sponsorship;
use Bidcoz\Bundle\CoreBundle\Entity\Sponsorship\SponsorshipLevel;
use Bidcoz\Bundle\CoreBundle\Entity\Ticket\SeatingChartImage;
use Bidcoz\Bundle\CoreBundle\Entity\Ticket\Ticket;
use Bidcoz\Bundle\CoreBundle\Entity\Ticket\TicketGroup;
use Bidcoz\Bundle\CoreBundle\Entity\Ticket\TicketType;
use Bidcoz\Bundle\CoreBundle\Entity\Transaction\Transaction;
use Bidcoz\Bundle\CoreBundle\ObjectChange\ObjectChangeTrackable;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Inflector\InflectorFactory;
use Doctrine\ORM\Event\PreFlushEventArgs;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serialize;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
/**
* @ORM\Entity(repositoryClass="CampaignRepository")
* @ORM\Table(
* name="campaigns",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="campaign_slug_org_id_uk",columns={"slug", "organization_id"})
* },
* )
* @ORM\HasLifecycleCallbacks()
* @Serialize\ExclusionPolicy("all")
*/
class Campaign implements Themeable, ObjectChangeTrackable
{
public const FEE_USER = 'user';
public const FEE_ORGANIZATION = 'organization';
public const FEE_CHOICE = 'choice';
public const TICKET_TYPE_GENERAL_ADMISSION = 'general';
public const TICKET_TYPE_ASSIGNED = 'assigned';
// const TICKET_TYPE_RESERVED = 'reserved';
public const DEFAULT_TIMEZONE = 'America/Chicago';
/**
* List of all available components
* keys names must be an underscore version
* of a Campaign's component property name without 'has_' prefix
* e.g. hasItemDonations --> item_donations.
*
* @var array
*/
private static $components = [
'auction' => 'Auction',
'sponsorship' => 'Sponsor Ads',
'cash_donations' => 'Donation Booster',
'fund_drive' => 'Appeal',
'procurement' => 'Procurement',
'tickets' => 'Tickets',
'registrations' => 'Registrations',
'paddle_raise' => 'Paddle Raise',
//TODO: Keep legacy name 'volunteers'.
//Needs proper refactoring. Used for Campaign::hasVolunteers in code and templates.
'volunteers' => 'Crewup',
];
public static function getComponentsList()
{
return self::$components;
}
/**
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Serialize\Expose
* @Serialize\Groups({"Default", "API"})
*/
protected ?int $id = null;
/**
* @ORM\Column(name="name", type="text")
* @Assert\NotBlank
* @Serialize\Expose
* @Serialize\Groups({"Default", "API"})
*/
protected $name;
/**
* @ORM\Column(name="slug", type="string", length=50);
* @Assert\NotBlank(message="Campaign URL is required")
* @Assert\Regex(pattern="/^[0-9a-z-]+$/", message="Campaign URL can only container lower-case letters, numbers and dashes")
* @Serialize\Expose
* @Serialize\Groups({"Default", "API"})
*/
protected $slug;
/**
* @ORM\ManyToOne(targetEntity="Organization", inversedBy="campaigns")
* @ORM\JoinColumn(name="organization_id", referencedColumnName="id", onDelete="CASCADE")
* @Serialize\Expose
* @Serialize\Groups({"API"})
*/
protected ?Organization $organization = null;
/**
* @ORM\Column(name="active", type="boolean");
*/
protected $active = true;
/**
* @ORM\Column(name="description", type="text", nullable=true)
*/
protected $description;
/**
* @ORM\Column(name="service_fee_type", type="text", length=20);
*/
protected $feeType = self::FEE_USER;
/**
* @ORM\Column(name="transaction_fee_passthrough", type="boolean", options={"default" : 0})
* @Serialize\Expose
*/
protected $transactionFeePassthrough = false;
/**
* @ORM\Column(name="collect_cc_info", type="boolean", options={"default" : 1})
* @Serialize\Expose
*/
protected $collectCcInfo = true;
/**
* @ORM\Column(name="details_title", type="text", nullable=true);
*/
protected $detailsTitle;
/**
* @ORM\Column(name="details_body", type="text", nullable=true);
*/
protected $detailsBody;
/**
* @ORM\Column(name="homepage_content", type="text", nullable=true);
*/
protected $homepageContent;
/**
* @ORM\Embedded(class="VideoEmbed", columnPrefix="video_")
*/
protected $video;
/**
* @ORM\Column(name="has_auction", type="boolean")
* @Serialize\Expose
*/
protected $hasAuction = false;
/**
* @ORM\Column(name="has_shop", type="boolean")
* @Serialize\Expose
*/
protected $hasShop = false;
/**
* @ORM\Column(name="has_fund_a_need", type="boolean")
* @Serialize\Expose
*/
protected $hasFundANeed = false;
/**
* @ORM\OneToOne(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Auction\Auction", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Auction $auction = null;
/**
* @ORM\OneToOne(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Auction\Shop", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Shop $shop = null;
/**
* @ORM\OneToOne(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Auction\FundANeed", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?FundANeed $fundANeed = null;
/**
* @ORM\Column(name="has_sponsorship", type="boolean")
* @Assert\NotNull
*/
protected $hasSponsorship = false;
/**
* @ORM\Column(name="sponsorship_signup", type="boolean")
* @Assert\NotNull
*/
protected $sponsorshipSignup = true;
/**
* @var Collection|Sponsorship[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Sponsorship\Sponsorship", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $sponsorships = null;
/**
* @var Collection|SponsorshipLevel[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Sponsorship\SponsorshipLevel", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $sponsorshipLevels = null;
/**
* @ORM\Column(name="has_tickets", type="boolean")
* @Assert\NotNull
*/
protected $hasTickets = false;
/**
* @ORM\Column(name="self_check_in_date", type="datetime", nullable=true)
*/
protected $selfCheckInDate;
/**
* @ORM\Column(name="ticket_type", type="string", length=8)
*/
protected $ticketType = self::TICKET_TYPE_GENERAL_ADMISSION;
/**
* @var Collection|SeatingChartImage[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Ticket\SeatingChartImage", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
* @Serialize\Expose
*/
protected ?Collection $seatingChartImages = null;
/**
* @ORM\Column(name="ticket_quantity", type="integer", nullable=true);
* @Assert\NotNull
* @Assert\Range(min=0)
*/
protected $ticketQuantity = 0;
/**
* @ORM\Column(name="ticket_end", type="datetime", nullable=true);
*/
protected $ticketEnd;
/**
* @var Collection|Ticket[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Ticket\Ticket", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $tickets = null;
/**
* @var Collection|TicketType[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Ticket\TicketType", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $ticketTypes = null;
/**
* @ORM\Column(name="ticket_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $ticketDisplayName = 'Ticket';
/**
* @ORM\Column(name="shop_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $shopDisplayName = 'Shop';
/**
* @ORM\Column(name="fundaneed_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $fundANeedDisplayName = 'Fund A Need';
/**
* @ORM\Column(name="crew_up_setup_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $crewUpSetupDisplayName = 'CrewUp';
/**
* @ORM\Column(name="crew_up_setup_text_description", type="text", length=1000);
* @Serialize\Expose
*/
protected $crewUpSetupTextDescription = 'Join our CrewUp for an opportunity to serve and support our mission.';
/**
* @ORM\Column(name="paddle_raise_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $paddleRaiseDisplayName = 'Paddle Raise';
/**
* @ORM\Column(name="raffle_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $raffleDisplayName = 'Raffle';
/**
* @ORM\Column(name="shop_goal", type="decimal", scale=2, precision=10);
* @Assert\Range(min=0)
*/
protected $shopGoal = 0;
/**
* @ORM\Column(name="fund_a_need_goal", type="decimal", scale=2, precision=10);
* @Assert\Range(min=0)
*/
protected $fundANeedGoal = 0;
/**
* @ORM\Column(name="paddle_raise_goal", type="decimal", scale=2, precision=10);
* @Assert\Range(min=0)
*/
protected $paddleRaiseGoal = 0;
/**
* @ORM\Column(name="external_purchase_display_name", type="text", length=20);
* @Serialize\Expose
*/
protected $externalPurchaseDisplayName = 'External';
/**
* @var Collection|Registration[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Registration\Registration", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $registrations = null;
/**
* @var Collection|Purchase[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Purchase\Purchase", mappedBy="campaign", orphanRemoval=true, cascade={"persist", "remove"})
*/
protected ?Collection $purchases = null;
/**
* @var Collection|Transaction[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Transaction\Transaction", mappedBy="campaign", cascade={"persist", "remove"})
*/
protected ?Collection $transactions = null;
/**
* @var Collection|CashDonation[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Donation\CashDonation", mappedBy="campaign", cascade={"persist"})
*/
protected ?Collection $donations = null;
/**
* @var Collection|DonationLevel[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Donation\DonationLevel", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $donationLevels = null;
/**
* @ORM\Column(name="has_item_donations", type="boolean")
* @Assert\NotNull
*/
protected $hasItemDonations = false;
/**
* @ORM\Column(name="has_procurement", type="boolean")
* @Assert\NotNull
*/
protected $hasProcurement = false;
/**
* @var Collection|Item[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Procurement\Item", mappedBy="campaign", cascade={"remove", "persist"})
*/
protected ?Collection $donatedItems = null;
/**
* @ORM\Column(name="has_cash_donations", type="boolean")
* @Assert\NotNull
*/
protected $hasCashDonations = false;
/**
* @ORM\Column(name="has_fund_drive", type="boolean")
* @Assert\NotNull
*/
protected $hasFundDrive = false;
/**
* @ORM\Column(name="fund_drive_name", type="string", length=255, nullable=true);
*/
protected $fundDriveName;
/**
* @ORM\Column(name="fund_drive_begin", type="datetime", nullable=true);
*/
protected $fundDriveBegin;
/**
* @ORM\Column(name="fund_drive_end", type="datetime", nullable=true);
*/
protected $fundDriveEnd;
/**
* An arbitrary string to be displayed on your customer’s credit card statement.
*
* @ORM\Column(name="payment_notice", type="string", length=22, nullable=true);
* @Assert\Regex(
* pattern="/[^<>\x22']/",
* message="The statement description may not include < > "" ' characters"
* )
* @Assert\Length(max = 22)
*/
protected $paymentNotice;
/**
* @var Collection|MembershipLevel[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Donation\MembershipLevel", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $membershipLevels = null;
/**
* @ORM\Column(name="has_membership", type="boolean")
* @Assert\NotNull
*/
protected $hasMembership = false;
/**
* @ORM\Column(name="membership_begin", type="datetime", nullable=true);
*/
protected $membershipBegin;
/**
* @ORM\Column(name="membership_end", type="datetime", nullable=true);
*/
protected $membershipEnd;
/**
* @ORM\Column(name="encourage_cash_donations", type="boolean")
* @Assert\NotNull
*/
protected $encourageCashDonations = true;
/**
* @ORM\Column(name="show_cash_donations", type="boolean")
* @Assert\NotNull
*/
protected $showCashDonations = true;
/**
* @ORM\Column(name="goal_cash_donations", type="decimal", scale=2, precision=10);
* @Assert\Range(min=0)
*/
protected $cashDonationGoal = 0;
/**
* @ORM\Column(name="goal_cash_donation_display", type="boolean")
* @Assert\NotNull
*/
protected $displayCashDonationGoal = false;
/**
* @ORM\Column(name="goal_cash_donation_display_progress", type="boolean")
* @Assert\NotNull
*/
protected $displayCashDonationGoalProgress = false;
/**
* @var Collection|CryptoWallet[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Donation\CryptoWallet", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $cryptoWallets = null;
/**
* @ORM\Column(name="has_registrations", type="boolean")
* @Serialize\Expose
*/
protected $hasRegistrations = false;
/**
* @var Collection|RaffleType[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Raffle\RaffleType", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $raffleTypes = null;
/**
* @var Collection|RegistrationType[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Registration\RegistrationType", mappedBy="campaign", orphanRemoval=true, cascade={"persist"})
*/
protected ?Collection $registrationTypes = null;
/**
* @ORM\Column(name="require_registration_waiver", type="boolean")
* @Assert\NotNull
*/
protected $requireRegistrationWaiver = false;
/**
* @ORM\Column(name="registration_waiver", type="text", nullable=true);
*/
protected $registrationWaiver;
/**
* @ORM\Column(name="registration_start", type="datetime", nullable=true);
*/
protected $registrationStart;
/**
* @ORM\Column(name="registration_end", type="datetime", nullable=true);
*/
protected $registrationEnd;
/**
* @ORM\Column(name="has_paddle_raise", type="boolean", nullable=true)
*/
protected $hasPaddleRaise = false;
/**
* @ORM\Column(name="show_paddle_raise_mobile", type="boolean", nullable=true)
*/
protected $showPaddleRaiseMobileBtn = false;
/**
* @ORM\Column(name="has_display_feeds", type="boolean", nullable=true)
*/
protected $hasDisplayFeeds = false;
/**
* @ORM\Column(name="has_volunteers", type="boolean", nullable=true)
*/
protected $hasVolunteers = false;
/**
* @ORM\Embedded(class="Theme", columnPrefix="campaign_")
* @Assert\Valid
*/
protected ?Theme $theme = null;
/**
* @ORM\ManyToOne(targetEntity="Image", cascade={"remove", "persist"})
* @ORM\JoinColumn(name="banner_image_id", referencedColumnName="id", onDelete="CASCADE")
* @Serialize\Expose
*/
protected ?Image $bannerImage = null;
/**
* @ORM\ManyToOne(targetEntity="Image", cascade={"remove", "persist"})
* @ORM\JoinColumn(name="logo_image_id", referencedColumnName="id", onDelete="CASCADE")
* @Serialize\Expose
*/
protected ?Image $logo = null;
/**
* @ORM\Column(name="timezone", type="string", length=100);
*/
protected $timezone;
/**
* @ORM\Column(name="perpetual", type="boolean")
*/
protected $perpetual = false;
/**
* @ORM\Column(name="pay_by_check", type="boolean")
*/
protected $payByCheck = false;
/**
* @ORM\Column(name="hold_items_in_cart", type="boolean")
* @Serialize\Expose
*/
protected $holdItemsInCart = false;
/**
* @ORM\Column(name="allow_custom_payment_instructions", type="boolean")
*/
protected $allowCustomPaymentInstructions = false;
/**
* @ORM\Column(name="custom_payment_instructions", type="text", nullable=true)
*/
protected $customPaymentInstructions;
/**
* @ORM\Column(name="donation_text", type="text", nullable=true)
*/
protected $donationText;
/**
* @ORM\Column(name="sms_reply", type="string", length=20, nullable=true)
*/
protected $smsReply;
/**
* @ORM\Column(name="has_raffle", type="boolean")
*/
protected $hasRaffle = false;
/**
* @ORM\Column(name="raffle_start", type="datetime", nullable=true);
*/
protected $raffleStart;
/**
* @ORM\Column(name="raffle_end", type="datetime", nullable=true);
*/
protected $raffleEnd;
/**
* @ORM\Column(name="raffle_show_winners_on_homepage", type="boolean", options={"default" : 0})
*/
protected $raffleShowWinnersOnHomepage = false;
/**
* @ORM\OneToOne(
* targetEntity="Bidcoz\Bundle\CoreBundle\Entity\TwilioCampaign",
* mappedBy="campaign",
* orphanRemoval=true,
* cascade={"persist", "refresh"}
* )
*/
protected ?TwilioCampaign $twilioCampaign = null;
/**
* Fees are stored in integer field in DB as (value * 100), e.g. 5% = 500.
*
* @ORM\Column(name="fees", type="smallint", options={"default":500})
* @Assert\Range(
* min = 0,
* max = 1000,
* notInRangeMessage = "Fees must be between 0% and 10%"
* )
*/
protected $fees = 500;
/**
* @var Collection|CampaignDetail[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Contact\CampaignDetail", mappedBy="campaign", orphanRemoval=true, cascade={"persist", "remove"})
*/
protected ?Collection $campaignDetails = null;
/**
* @var Collection|BidNumber[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Auction\BidNumber", mappedBy="campaign", cascade={"persist", "remove"})
*/
protected ?Collection $bidNumbers = null;
/**
* @var Collection|TicketGroup[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Ticket\TicketGroup", mappedBy="campaign", cascade={"persist", "remove"})
*/
protected ?Collection $ticketGroups = null;
/**
* @var Collection|ItemTemplate[]|null
* @ORM\OneToMany(targetEntity="Bidcoz\Bundle\CoreBundle\Entity\Email\ItemTemplate", mappedBy="campaign", cascade={"persist", "remove"})
*/
protected ?Collection $itemTemplates = null;
/**
* @ORM\Column(name="send_purchase_email", type="boolean")
* @Serialize\Expose
*/
protected $sendPurchaseEmail = true;
/**
* @ORM\Column(name="created_at", type="datetime")
* @Serialize\Expose
*/
protected $createdAt;
public function __construct(Organization $organization)
{
$this->organization = $organization;
$this->sponsorships = new ArrayCollection();
$this->tickets = new ArrayCollection();
$this->ticketTypes = new ArrayCollection();
$this->purchases = new ArrayCollection();
$this->donations = new ArrayCollection();
$this->registrationTypes = new ArrayCollection();
$this->raffleTypes = new ArrayCollection();
$this->campaignDetails = new ArrayCollection();
$this->theme = new Theme();
$this->timezone = self::DEFAULT_TIMEZONE;
$this->createdAt = new DateTime();
}
public function setId(?int $id): void
{
$this->id = $id;
}
public function getId()
{
return $this->id;
}
public function setName($name)
{
$this->name = $name;
}
public function getName()
{
return $this->name;
}
public function setSlug($slug)
{
$this->slug = $slug;
}
public function getSlug()
{
return $this->slug;
}
public function getOrganization()
{
return $this->organization;
}
public function setOrganization(Organization $organization)
{
$this->organization = $organization;
}
public function setActive($active)
{
$this->active = $active;
}
public function isActive()
{
return $this->active;
}
public function setDescription($description)
{
$this->description = $description;
}
public function getDescription()
{
return $this->description;
}
public function setFeeType(string $feeType)
{
$this->feeType = $feeType;
}
public function getFeeType()
{
return $this->feeType;
}
public function isUserChoiceFeeType(): bool
{
return self::FEE_CHOICE == $this->getFeeType();
}
public function setTransactionFeePassthrough(bool $transactionFeePassthrough)
{
$this->transactionFeePassthrough = $transactionFeePassthrough;
}
public function getTransactionFeePassthrough(): bool
{
return $this->transactionFeePassthrough;
}
public function setCollectCcInfo(bool $collectCcInfo)
{
$this->collectCcInfo = $collectCcInfo;
}
public function getCollectCcInfo(): bool
{
return $this->collectCcInfo && ($this->hasAuction() || $this->hasTickets());
}
public static function getFeeChoices(Organization $organization = null)
{
return [
self::FEE_USER => 'Require Users to pay Fee',
self::FEE_CHOICE => 'Offer Users the option to decline Fee',
];
}
public function getCurrency()
{
return $this->organization->getCurrency();
}
public function isOver()
{
$now = new DateTime();
return $now > $this->campaignEnd;
}
/**
* @Assert\Callback
*/
public function ensureFundDriveDatesValid(ExecutionContextInterface $context)
{
if ($this->fundDriveBegin && $this->fundDriveEnd && $this->fundDriveBegin > $this->fundDriveEnd) {
$context->buildViolation('Appeal Start must be before Appeal End')
->atPath('fundDriveBegin')
->addViolation();
}
}
/**
* @Assert\Callback
*/
public function ensureMembershipDatesValid(ExecutionContextInterface $context)
{
if ($this->membershipBegin && $this->membershipEnd && $this->membershipBegin > $this->membershipEnd) {
$context->buildViolation('Membership Start must be before Membership End')
->atPath('membershipBegin')
->addViolation();
}
}
public function setHasAuction($hasAuction)
{
$this->hasAuction = $hasAuction;
}
public function getHasAuction()
{
return $this->hasAuction;
}
public function hasAuction()
{
return $this->hasAuction;
}
public function auctionAvailable(): bool
{
if (!$this->hasAuction) {
return false;
}
return $this->getAuction()->isAvailable();
}
public function setHasShop($hasShop)
{
$this->hasShop = $hasShop;
}
public function getHasShop()
{
return $this->hasShop;
}
public function hasShop()
{
return $this->hasShop;
}
public function shopAvailable(): bool
{
return $this->hasShop;
}
public function setHasFundANeed($hasFundANeed)
{
$this->hasFundANeed = $hasFundANeed;
}
public function getHasFundANeed()
{
return $this->hasFundANeed;
}
public function hasFundANeed()
{
return $this->hasFundANeed;
}
public function fundANeedAvailable(): bool
{
return $this->hasFundANeed;
}
public function setAuction(?Auction $auction): void
{
$this->auction = $auction;
}
public function getAuction(): ?Auction
{
return $this->auction && Auction::class == get_class($this->auction)
? $this->auction
: null;
}
public function setShop(?Shop $shop)
{
$this->shop = $shop;
}
public function getShop(): ?Shop
{
return $this->shop;
}
public function setFundANeed(?FundANeed $fundANeed)
{
$this->fundANeed = $fundANeed;
}
public function getFundANeed(): ?FundANeed
{
return $this->fundANeed;
}
public function setHasSponsorship($hasSponsorship)
{
$this->hasSponsorship = $hasSponsorship;
}
public function getHasSponsorship()
{
return $this->hasSponsorship;
}
public function setSponsorshipSignup($sponsorshipSignup)
{
$this->sponsorshipSignup = $sponsorshipSignup;
}
public function getSponsorshipSignup()
{
return $this->sponsorshipSignup;
}
public function setHasTickets($hasTickets)
{
$this->hasTickets = $hasTickets;
}
public function getHasTickets()
{
return $this->hasTickets;
}
public function hasTickets()
{
return $this->hasTickets;
}
public function setTicketType($ticketType)
{
$this->ticketType = $ticketType;
}
public function getTicketType()
{
return $this->ticketType ?: self::TICKET_TYPE_GENERAL_ADMISSION;
}
public static function getTicketTypeChoices()
{
return [
self::TICKET_TYPE_GENERAL_ADMISSION => 'General Admission',
// self::TICKET_TYPE_RESERVED => 'Reserved Seating',
self::TICKET_TYPE_ASSIGNED => 'Assigned Seating',
];
}
public function hasSelfCheckIn()
{
return null !== $this->selfCheckInDate;
}
public function setSelfCheckInDate(DateTime $selfCheckInDate = null)
{
$this->selfCheckInDate = $selfCheckInDate;
}
public function getSelfCheckInDate()
{
return $this->selfCheckInDate;
}
public function selfCheckInAvailable(): bool
{
$now = new DateTime();
return $this->hasSelfCheckIn() && $now > $this->getSelfCheckInDate();
}
public function hasTicketAssignment()
{
return in_array($this->getTicketType(), [
// self::TICKET_TYPE_RESERVED,
self::TICKET_TYPE_ASSIGNED,
]);
}
public function isReservedSeating()
{
// return self::TICKET_TYPE_RESERVED === $this->getTicketType();
return;
}
public function getSeatingChartImages()
{
return $this->seatingChartImages;
}
public function addSeatingChartImage(SeatingChartImage $image)
{
if (!$this->seatingChartImages->contains($image)) {
$this->seatingChartImages->add($image);
}
}
public function removeSeatingChartImage(SeatingChartImage $image)
{
if ($this->seatingChartImages->contains($image)) {
$this->seatingChartImages->removeElement($image);
}
}
public function setPrimarySeatingChartImage(SeatingChartImage $image)
{
foreach ($this->seatingChartImages as $i) {
$i->setPrimary(false);
}
$image->setPrimary(true);
}
public function getPrimarySeatingChartImage()
{
$filtered = $this->getSeatingChartImages()->filter(function ($image) {
return $image->isPrimary();
});
return $filtered->first();
}
public function setTicketQuantity($ticketQuantity)
{
$this->ticketQuantity = $ticketQuantity;
}
public function getTicketQuantity()
{
return $this->ticketQuantity;
}
public function setTicketEnd(DateTime $date)
{
$this->ticketEnd = $date;
}
public function getTicketEnd()
{
return $this->ticketEnd;
}
public function setDetailsTitle($detailsTitle)
{
$this->detailsTitle = $detailsTitle;
}
public function getDetailsTitle()
{
return $this->detailsTitle;
}
public function setDetailsBody($detailsBody)
{
$this->detailsBody = $detailsBody;
}
public function getDetailsBody()
{
return $this->detailsBody;
}
public function setHomepageContent($homepageContent)
{
$this->homepageContent = $homepageContent;
}
public function getHomepageContent()
{
return $this->homepageContent;
}
public function setVideo(VideoEmbed $video)
{
$this->video = $video;
}
public function getVideo()
{
return $this->video;
}
public function ticketsAvailable()
{
// TODO
return true;
}
public function getTickets()
{
return $this->tickets;
}
public function getTicketTypes()
{
return $this->ticketTypes;
}
public function addTicketType(TicketType $ticketType): void
{
if (!$this->ticketTypes->contains($ticketType)) {
$this->ticketTypes->add($ticketType);
}
}
public function removeTicketType(TicketType $ticketType): void
{
if ($this->ticketTypes->contains($ticketType)) {
$this->ticketTypes->removeElement($ticketType);
}
}
public function setTicketDisplayName(string $ticketDisplayName)
{
$this->ticketDisplayName = $ticketDisplayName;
}
public function getTicketDisplayName(): string
{
return $this->ticketDisplayName;
}
public function setShopDisplayName(string $shopDisplayName)
{
$this->shopDisplayName = $shopDisplayName;
}
public function getShopDisplayName(): string
{
return $this->shopDisplayName;
}
public function setFundANeedDisplayName(string $fundANeedDisplayName)
{
$this->fundANeedDisplayName = $fundANeedDisplayName;
}
public function getPaddleRaiseDisplayName(): string
{
return $this->paddleRaiseDisplayName;
}
public function setPaddleRaiseDisplayName(string $paddleRaiseDisplayName)
{
$this->paddleRaiseDisplayName = $paddleRaiseDisplayName;
}
public function getRaffleDisplayName(): string
{
return $this->raffleDisplayName;
}
public function setRaffleDisplayName(string $raffleDisplayName)
{
$this->raffleDisplayName = $raffleDisplayName;
}
public function getFundANeedDisplayName(): string
{
return $this->fundANeedDisplayName;
}
public function setExternalPurchaseDisplayName(string $externalPurchaseDisplayName)
{
$this->externalPurchaseDisplayName = $externalPurchaseDisplayName;
}
public function getExternalPurchaseDisplayName(): string
{
return $this->externalPurchaseDisplayName;
}
public function setHasItemDonations($hasItemDonations)
{
$this->hasItemDonations = $hasItemDonations;
}
public function getHasItemDonations()
{
return $this->hasProcurement && $this->hasItemDonations;
}
public function setHasProcurement($hasProcurement)
{
$this->hasProcurement = $hasProcurement;
}
public function getHasProcurement()
{
return $this->hasProcurement;
}
public function setHasCashDonations($hasCashDonations)
{
$this->hasCashDonations = $hasCashDonations;
}
public function getHasCashDonations()
{
return $this->hasCashDonations;
}
public function hasCashDonations()
{
return $this->hasCashDonations;
}
public function setHasFundDrive($hasFundDrive)
{
$this->hasFundDrive = $hasFundDrive;
}
public function getHasFundDrive()
{
return $this->hasFundDrive;
}
public function isFundDriveEnabled()
{
$now = new DateTime();
return $this->hasFundDrive &&
(!$this->fundDriveBegin || $this->fundDriveBegin < $now) &&
(!$this->fundDriveEnd || $this->fundDriveEnd > $now);
}
public function hasFundDrive()
{
return $this->hasFundDrive;
}
public function setFundDriveName($fundDriveName)
{
$this->fundDriveName = $fundDriveName;
}
public function getFundDriveName()
{
return $this->fundDriveName;
}
public function setFundDriveBegin(DateTime $fundDriveBegin = null)
{
$this->fundDriveBegin = $fundDriveBegin;
}
public function getFundDriveBegin()
{
return $this->fundDriveBegin;
}
public function setFundDriveEnd(DateTime $fundDriveEnd = null)
{
$this->fundDriveEnd = $fundDriveEnd;
}
public function getFundDriveEnd()
{
return $this->fundDriveEnd;
}
public function setPaymentNotice($paymentNotice)
{
$this->paymentNotice = $paymentNotice;
}
public function getPaymentNotice()
{
return $this->paymentNotice;
}
public function getDonationLevels(): ?Collection
{
return $this->donationLevels;
}
public function setDonationLevels(?Collection $donationLevels): void
{
$this->donationLevels = $donationLevels;
}
public function getMembershipLevels()
{
return $this->membershipLevels;
}
public function setHasMembership($hasMembership)
{
$this->hasMembership = $hasMembership;
}
public function getHasMembership()
{
return $this->hasMembership;
}
public function isMembershipEnabled()
{
$now = new DateTime();
return $this->hasMembership &&
(!$this->membershipBegin || $this->membershipBegin < $now) &&
(!$this->membershipEnd || $this->membershipEnd > $now);
}
public function hasMembership()
{
return $this->hasMembership;
}
public function setMembershipBegin(DateTime $membershipBegin = null)
{
$this->membershipBegin = $membershipBegin;
}
public function getMembershipBegin()
{
return $this->membershipBegin;
}
public function setMembershipEnd(DateTime $membershipEnd = null)
{
$this->membershipEnd = $membershipEnd;
}
public function getMembershipEnd()
{
return $this->membershipEnd;
}
public function setEncourageCashDonations($encourageCashDonations)
{
$this->encourageCashDonations = $encourageCashDonations;
}
public function getEncourageCashDonations()
{
return $this->encourageCashDonations;
}
public function setShowCashDonations($showCashDonations)
{
$this->showCashDonations = $showCashDonations;
}
public function getShowCashDonations()
{
return $this->showCashDonations;
}
public function setCashDonationGoal($cashDonationGoal)
{
$this->cashDonationGoal = $cashDonationGoal;
}
public function getCashDonationGoal()
{
return $this->cashDonationGoal;
}
public function setDisplayCashDonationGoal($displayCashDonationGoal)
{
$this->displayCashDonationGoal = $displayCashDonationGoal;
}
public function getDisplayCashDonationGoal()
{
return $this->displayCashDonationGoal;
}
public function setDisplayCashDonationGoalProgress($displayCashDonationGoalProgress)
{
$this->displayCashDonationGoalProgress = $displayCashDonationGoalProgress;
}
public function getDisplayCashDonationGoalProgress()
{
return $this->displayCashDonationGoalProgress;
}
public function getRaffleTypes()
{
return $this->raffleTypes;
}
public function setRaffleTypes($raffleTypes): void
{
$this->raffleTypes = $raffleTypes;
}
public function addRaffleType(RaffleType $raffleType): void
{
$this->raffleTypes->add($raffleType);
}
public function removeRaffleType(RaffleType $raffleType): void
{
$this->raffleTypes->removeElement($raffleType);
}
public function getActiveRaffles()
{
return $this->raffleTypes->filter(function (RaffleType $raffleType) {
return $raffleType->isActive();
});
}
public function setHasRegistrations($hasRegistrations)
{
$this->hasRegistrations = $hasRegistrations;
}
public function getHasRegistrations()
{
return $this->hasRegistrations;
}
public function getRegistrationTypes()
{
return $this->registrationTypes;
}
public function getCryptoWallets()
{
return $this->cryptoWallets;
}
public function setRequireRegistrationWaiver($requireRegistrationWaiver)
{
$this->requireRegistrationWaiver = $requireRegistrationWaiver;
}
public function getRequireRegistrationWaiver()
{
return $this->requireRegistrationWaiver;
}
public function setRegistrationWaiver($registrationWaiver)
{
$this->registrationWaiver = $registrationWaiver;
}
public function getRegistrationWaiver()
{
return $this->registrationWaiver;
}
public function setRegistrationStart($registrationStart)
{
$this->registrationStart = $registrationStart;
}
public function getRegistrationStart()
{
return $this->registrationStart;
}
public function setRegistrationEnd($registrationEnd)
{
$this->registrationEnd = $registrationEnd;
}
public function getRegistrationEnd()
{
return $this->registrationEnd;
}
public function isRegistrationActive()
{
$now = new DateTime();
return $now >= $this->registrationStart && $now <= $this->registrationEnd;
}
public function setHasPaddleRaise($hasPaddleRaise)
{
$this->hasPaddleRaise = $hasPaddleRaise;
}
public function getHasPaddleRaise()
{
return $this->hasPaddleRaise;
}
public function hasPaddleRaise()
{
return $this->hasPaddleRaise;
}
public function setShowPaddleRaiseMobileBtn($showPaddleRaiseMobileBtn)
{
$this->showPaddleRaiseMobileBtn = $showPaddleRaiseMobileBtn;
}
public function getShowPaddleRaiseMobileBtn()
{
return $this->showPaddleRaiseMobileBtn;
}
public function setHasDisplayFeeds($hasDisplayFeeds)
{
$this->hasDisplayFeeds = $hasDisplayFeeds;
}
public function getHasDisplayFeeds()
{
return $this->hasDisplayFeeds;
}
public function setHasVolunteers(bool $hasVolunteers)
{
$this->hasVolunteers = $hasVolunteers;
}
public function getHasVolunteers(): bool
{
return (bool) $this->hasVolunteers;
}
public function setTheme(?Theme $theme)
{
$this->theme = $theme;
}
public function getTheme()
{
return $this->theme;
}
public function setBannerImage(?Image $image)
{
$this->bannerImage = $image;
}
public function removeBannerImage(): void
{
$this->bannerImage = null;
}
public function getBannerImage(): ?Image
{
return $this->bannerImage;
}
public function setLogo(?Image $image = null)
{
$this->logo = $image;
}
public function removeLogo()
{
$this->logo = null;
}
public function getLogo()
{
return $this->logo;
}
public function isUrlEditable(): bool
{
// TODO
return !$this->isPerpetual();
if (!$this->id) {
return true;
}
}
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @Assert\Callback
*/
public function isReservedSlug(ExecutionContextInterface $context)
{
if (!preg_match('#'.Constants::RESERVED_CAMPAIGN_SLUG_REGEX.'#', $this->slug)) {
$context->buildViolation('This is a reserved url.')
->atPath('slug')
->addViolation();
}
}
public function setPerpetual($perpetual)
{
$this->perpetual = $perpetual;
}
public function isPerpetual()
{
return $this->perpetual;
}
public function setPayByCheck($payByCheck)
{
$this->payByCheck = $payByCheck;
}
public function isPayByCheck(): bool
{
return (bool) $this->payByCheck;
}
public function setHoldItemsInCart(bool $holdItemsInCart)
{
$this->holdItemsInCart = $holdItemsInCart;
}
public function getHoldItemsInCart(): bool
{
return (bool) $this->holdItemsInCart;
}
public function isUseFastList(): bool
{
// TODO - Currently ONLY CHG, can add db flag later
return 'chg' === $this->organization->getSlug();
}
public function isExternalPaymentAllowed(): bool
{
return $this->organization->isEnableCustomizations();
}
public function setAllowCustomPaymentInstructions(bool $allowCustomPaymentInstructions)
{
$this->allowCustomPaymentInstructions = $allowCustomPaymentInstructions;
}
public function getAllowCustomPaymentInstructions(): bool
{
return (bool) $this->allowCustomPaymentInstructions;
}
public function setCustomPaymentInstructions(string $customPaymentInstructions)
{
$this->customPaymentInstructions = $customPaymentInstructions;
}
public function getCustomPaymentInstructions()
{
return $this->customPaymentInstructions;
}
public function showCustomPaymentInstructions(): bool
{
return (bool) $this->allowCustomPaymentInstructions && $this->customPaymentInstructions;
}
public function setDonationText(string $donationText = null)
{
$this->donationText = $donationText;
}
public function getDonationText()
{
return $this->donationText;
}
public function isLocked()
{
return in_array($this->slug, ['donate']);
}
public function isHidden()
{
return in_array($this->slug, ['tryit']);
}
public function getCampaign()
{
return $this;
}
public function getObjectName()
{
return 'Campaign';
}
public function setTimeZone($timezone)
{
$this->timezone = $timezone;
}
public function getTimezone()
{
return $this->timezone ?: self::DEFAULT_TIMEZONE;
}
public function getTrackedParams()
{
return [
'slug' => 'URL',
'feeType' => 'Fee Type',
'hasAuction' => 'Has Auction',
'hasSponsorship' => 'Has Sponsorship',
'hasTickets' => 'Has Tickets',
'hasItemDonations' => 'Has Item Donations',
'hasCashDonations' => 'Has Cash Donations',
];
}
public function hasComponent($component)
{
if (!isset(self::$components[$component])) {
return false;
}
$property = InflectorFactory::create()->build()->camelize('has_'.$component);
return $property && isset($this->$property) && $this->$property;
}
public function setSmsReply(string $smsReply)
{
$this->smsReply = $smsReply;
}
public function getSmsReply()
{
return $this->smsReply;
}
public function setHasRaffle($hasRaffle)
{
$this->hasRaffle = $hasRaffle;
}
public function getHasRaffle()
{
return $this->hasRaffle;
}
public function setRaffleStart(DateTime $raffleStart)
{
$this->raffleStart = $raffleStart;
}
public function getRaffleStart()
{
return $this->raffleStart;
}
public function setRaffleEnd(DateTime $raffleEnd)
{
$this->raffleEnd = $raffleEnd;
}
public function getRaffleEnd()
{
return $this->raffleEnd;
}
public function isRaffleActive(): bool
{
$now = new DateTime();
return $this->hasRaffle && $now > $this->raffleStart && $now < $this->raffleEnd;
}
public function setRaffleShowWinnersOnHomepage(bool $raffleShowWinnersOnHomepage)
{
$this->raffleShowWinnersOnHomepage = $raffleShowWinnersOnHomepage;
}
public function getRaffleShowWinnersOnHomepage(): bool
{
return $this->raffleShowWinnersOnHomepage;
}
public function getTwilioCampaign()
{
return $this->twilioCampaign;
}
public function setTwilioCampaign($twilioCampaign)
{
$this->twilioCampaign = $twilioCampaign;
}
public function hasTwilioCampaign()
{
return (bool) $this->twilioCampaign && $this->twilioCampaign->getId();
}
/**
* @ORM\PreFlush
*/
public function checkTwilioCampaign(PreFlushEventArgs $event)
{
$em = $event->getEntityManager();
if ($this->getTwilioCampaign() && empty($this->getTwilioCampaign()->getNumber())) {
$em->remove($this->getTwilioCampaign());
$this->setTwilioCampaign(null);
}
}
// Fees are stored in integer field as value * 100, e.g. 5% = 500
public function getFees()
{
return $this->fees / 100;
}
public function setFees($fees)
{
$this->fees = (int) round($fees * 100);
}
/**
* @return Collection|CampaignDetail[]|null
*/
public function getCampaignDetails(): ?Collection
{
return $this->campaignDetails;
}
public function setCampaignDetails(?Collection $campaignDetails): void
{
$this->campaignDetails = $campaignDetails;
}
public function addCampaignDetail(CampaignDetail $campaignDetail): void
{
$this->campaignDetails->add($campaignDetail);
$campaignDetail->setCampaign($this);
}
public function removeCampaignDetail(CampaignDetail $campaignDetail): void
{
$this->campaignDetails->removeElement($campaignDetail);
$campaignDetail->setCampaign(null);
}
public function getSponsorships(): ?Collection
{
return $this->sponsorships;
}
public function setSponsorships(?Collection $sponsorships): void
{
$this->sponsorships = $sponsorships;
}
public function addSponsorship(Sponsorship $sponsorship): void
{
if (!$this->sponsorships->contains($sponsorship)) {
$this->sponsorships->add($sponsorship);
$sponsorship->setCampaign($this);
}
}
public function removeSponsorship(Sponsorship $sponsorship): void
{
if ($this->sponsorships->contains($sponsorship)) {
$this->sponsorships->removeElement($sponsorship);
$sponsorship->setCampaign(null);
}
}
public function getSponsorshipLevels(): ?Collection
{
return $this->sponsorshipLevels;
}
public function setSponsorshipLevels(?Collection $sponsorshipLevels): void
{
$this->sponsorshipLevels = $sponsorshipLevels;
}
public function getRegistrations(): ?Collection
{
return $this->registrations;
}
public function setRegistrations(?Collection $registrations): void
{
$this->registrations = $registrations;
}
/**
* @return Collection|Purchase[]|null
*/
public function getPurchases(): ?Collection
{
return $this->purchases;
}
public function getPaddleRaiseDonationPurchases(): ?Collection
{
$purchases = new ArrayCollection();
foreach ($this->purchases as $purchase) {
if ($purchase instanceof PaddleRaiseDonationPurchase) {
$purchases->add($purchase);
}
}
return $purchases;
}
public function setPurchases(?Collection $purchases): void
{
$this->purchases = $purchases;
}
public function addPurchase(Purchase $purchase): void
{
if (!$this->purchases->contains($purchase)) {
$this->purchases->add($purchase);
$purchase->setCampaign($this);
}
}
public function removePurchase(Purchase $purchase): void
{
if ($this->purchases->contains($purchase)) {
$this->purchases->removeElement($purchase);
$purchase->setCampaign(null);
}
}
public function getTransactions(): ?Collection
{
return $this->transactions;
}
public function setTransactions(?Collection $transactions): void
{
$this->transactions = $transactions;
}
public function addTransaction(Transaction $transaction): void
{
if (!$this->transactions->contains($transaction)) {
$this->transactions->add($transaction);
}
}
public function removeTransaction(Transaction $transaction): void
{
if ($this->transactions->contains($transaction)) {
$this->transactions->removeElement($transaction);
}
}
public function getDonations(): ?Collection
{
return $this->donations;
}
public function setDonations(?Collection $donations): void
{
$this->donations = $donations;
}
public function getDonatedItems(): ?Collection
{
return $this->donatedItems;
}
public function setDonatedItems(?Collection $donatedItems): void
{
$this->donatedItems = $donatedItems;
}
public function getBidNumbers(): ?Collection
{
return $this->bidNumbers;
}
public function setBidNumbers(?Collection $bidNumbers): void
{
$this->bidNumbers = $bidNumbers;
}
public function addBidNumber(BidNumber $bidNumber): void
{
if (!$this->bidNumbers->contains($bidNumber)) {
$this->bidNumbers->add($bidNumber);
}
}
public function removeBidNumber(BidNumber $bidNumber): void
{
if ($this->bidNumbers->contains($bidNumber)) {
$this->bidNumbers->removeElement($bidNumber);
}
}
public function getTicketGroups(): ?Collection
{
return $this->ticketGroups;
}
public function setTicketGroups(?Collection $ticketGroups): void
{
$this->ticketGroups = $ticketGroups;
}
public function addTicketGroup(TicketGroup $ticketGroup): void
{
if (!$this->ticketGroups->contains($ticketGroup)) {
$this->ticketGroups->add($ticketGroup);
}
}
public function removeTicketGroup(TicketGroup $ticketGroup): void
{
if ($this->ticketGroups->contains($ticketGroup)) {
$this->ticketGroups->removeElement($ticketGroup);
}
}
public function setShopGoal($goal)
{
$this->shopGoal = $goal;
}
public function getShopGoal()
{
return $this->shopGoal;
}
public function setFundANeedGoal($goal)
{
$this->fundANeedGoal = $goal;
}
public function getFundANeedGoal()
{
return $this->fundANeedGoal;
}
public function setPaddleRaiseGoal($goal)
{
$this->paddleRaiseGoal = $goal;
}
public function getPaddleRaiseGoal()
{
return $this->paddleRaiseGoal;
}
public function setSendPurchaseEmail(bool $sendPurchaseEmail)
{
$this->sendPurchaseEmail = $sendPurchaseEmail;
}
public function getSendPurchaseEmail(): bool
{
return $this->sendPurchaseEmail;
}
public function getCrewUpSetupDisplayName(): string
{
return $this->crewUpSetupDisplayName;
}
public function setCrewUpSetupDisplayName(string $crewUpSetupDisplayName): self
{
$this->crewUpSetupDisplayName = $crewUpSetupDisplayName;
return $this;
}
public function getCrewUpSetupTextDescription(): ?string
{
return ($this->crewUpSetupTextDescription === null || $this->crewUpSetupTextDescription === '')
? null
: $this->crewUpSetupTextDescription;
}
public function setCrewUpSetupTextDescription(?string $crewUpSetupTextDescription): self
{
$this->crewUpSetupTextDescription = ($crewUpSetupTextDescription === '' ? null : $crewUpSetupTextDescription);
return $this;
}
}