| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- <?php
- namespace AppBundle\Entity\Donor;
- use AppBundle\Annotation\DefaultField;
- use AppBundle\Entity\AccessAndFunction\Access;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Entity\Traits\ActivityPeriodTrait;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Don d'un Access à une Organization
- *
- * @Iri("http://schema.org/Donor")
- */
- #[ORM\Entity]
- class Donor
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- use ActivityPeriodTrait;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['donor', 'donor_list', 'access_details', 'access_details_organization'])]
- private $id;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'donors')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['donor', 'donor_list', 'access_details_organization'])]
- private $access;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 40, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['donor', 'donor_list', 'access_details_donorsfiltered'])]
- private $wording;
- /**
- * @var float
- *
- *
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['donor', 'donor_list', 'access_details_donorsfiltered'])]
- private $amount;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['donor', 'donor_list'])]
- private $paymentDate;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false], nullable: true)]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['donor', 'donor_list'])]
- private $emailVisibility;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false], nullable: true)]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['donor', 'donor_list'])]
- private $logoVisibility;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false], nullable: true)]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['donor', 'donor_list', 'access_details_organization'])]
- private $donorVisibility;
- /**
- * @var string
- */
- #[ORM\Column(type: 'simple_array', nullable: true)]
- #[Assert\Type(type: 'array')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Donor\DonorDisplayedOnEnum', 'toArray'], multiple: true)]
- #[Groups(['donor'])]
- private $displayedOn;
- /**
- * @var Organization
- *
- * @DefaultField()
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'donors')]
- #[Groups(['donor'])]
- private $organization;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false], nullable: true)]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['donor', 'donor_list', 'access_details_organization'])]
- private $federationDisplay;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false], nullable: true)]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['donor', 'donor_list', 'access_details_organization'])]
- private $associationDisplay;
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets access.
- *
- * @param Access $access
- *
- * @return $this
- */
- public function setAccess(Access $access)
- {
- $this->access = $access;
- return $this;
- }
- /**
- * Gets access.
- *
- * @return Access
- */
- public function getAccess()
- {
- return $this->access;
- }
- /**
- * Sets wording.
- *
- * @param string $wording
- *
- * @return $this
- */
- public function setWording($wording)
- {
- $this->wording = $wording;
- return $this;
- }
- /**
- * Gets wording.
- *
- * @return string
- */
- public function getWording()
- {
- return $this->wording;
- }
- /**
- * Sets organization.
- *
- * @param Organization $organization
- *
- * @return $this
- */
- public function setOrganization(Organization $organization)
- {
- $this->organization = $organization;
- return $this;
- }
- /**
- * Gets organization.
- *
- * @return Organization
- */
- public function getOrganization()
- {
- return $this->organization;
- }
- /**
- * Sets amount.
- *
- * @param float $amount
- *
- * @return $this
- */
- public function setAmount($amount)
- {
- $amount = floatval($amount);
- $this->amount = $amount;
- return $this;
- }
- /**
- * Gets amount.
- *
- * @return float
- */
- public function getAmount()
- {
- return $this->amount;
- }
- /**
- * Sets paymentDate.
- *
- * @param \DateTime $paymentDate
- *
- * @return $this
- */
- public function setPaymentDate(\DateTime $paymentDate = null)
- {
- $this->paymentDate = $paymentDate;
- return $this;
- }
- /**
- * Gets paymentDate.
- *
- * @return \DateTime
- */
- public function getPaymentDate()
- {
- return $this->paymentDate ? $this->paymentDate->format('Y-m-d') : $this->paymentDate;
- }
- /**
- * Sets emailVisibility.
- *
- * @param bool $emailVisibility
- *
- * @return $this
- */
- public function setEmailVisibility($emailVisibility)
- {
- $this->emailVisibility = $emailVisibility;
- return $this;
- }
- /**
- * Gets emailVisibility.
- *
- * @return bool
- */
- public function getEmailVisibility()
- {
- return $this->emailVisibility;
- }
- /**
- * Sets logoVisibility.
- *
- * @param bool $logoVisibility
- *
- * @return $this
- */
- public function setLogoVisibility($logoVisibility)
- {
- $this->logoVisibility = $logoVisibility;
- return $this;
- }
- /**
- * Gets logoVisibility.
- *
- * @return bool
- */
- public function getLogoVisibility()
- {
- return $this->logoVisibility;
- }
- /**
- * Sets displayedOn.
- *
- * @param string $displayedOn
- *
- * @return $this
- */
- public function setDisplayedOn($displayedOn)
- {
- $this->displayedOn = $displayedOn;
- return $this;
- }
- /**
- * Gets displayedOn.
- *
- * @return string
- */
- public function getDisplayedOn()
- {
- return $this->displayedOn;
- }
- /**
- * @return bool
- */
- public function isDonorVisibility()
- {
- return $this->donorVisibility;
- }
- /**
- * @param bool $donorVisibility
- */
- public function setDonorVisibility($donorVisibility)
- {
- $this->donorVisibility = $donorVisibility;
- }
- /**
- * Set federationDisplay
- *
- * @param boolean $federationDisplay
- *
- * @return Donor
- */
- public function setFederationDisplay($federationDisplay)
- {
- $this->federationDisplay = $federationDisplay;
- return $this;
- }
- /**
- * Get federationDisplay
- *
- * @return boolean
- */
- public function getFederationDisplay()
- {
- return $this->federationDisplay;
- }
- /**
- * Set associationDisplay
- *
- * @param boolean $associationDisplay
- *
- * @return Donor
- */
- public function setAssociationDisplay($associationDisplay)
- {
- $this->associationDisplay = $associationDisplay;
- return $this;
- }
- /**
- * Get associationDisplay
- *
- * @return boolean
- */
- public function getAssociationDisplay()
- {
- return $this->associationDisplay;
- }
- }
|