| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489 |
- <?php
- namespace AppBundle\Entity\Product;
- use AppBundle\Entity\Billing\AccessIntangible;
- use AppBundle\Entity\Billing\EducationalProjectIntangible;
- use AppBundle\Entity\Education\EducationCurriculum;
- use Doctrine\Common\Collections\ArrayCollection;
- 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\Validator\Constraints\Booking as OpentalentEventAssert;
- /**
- * Service ou produit à facturer (cours)
- *
- * @Iri("http://schema.org/Intangible")
- */
- #[ORM\Entity]
- class Intangible extends AbstractProduct
- {
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 100, nullable: false)]
- #[Assert\NotNull]
- #[Assert\Type(type: 'string')]
- #[Groups(['intangible', 'access_details_accessintangibles', 'educational_project_intangible_list', 'access_intangible_list', 'intangible_list', 'educationalproject_details_educationalprojectintangibles', 'access_intangible_list_intangible'])]
- private $label;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PeriodicityTypeEnum', 'toArray'])]
- #[Groups(['intangible', 'educational_project_intangible_list', 'access_intangible_list', 'intangible_list', 'access_intangible_list_intangible'])]
- private $billingPeriodicityType;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Billing\PeriodicityEnum', 'toArray'])]
- #[Groups(['intangible', 'educational_project_intangible_list', 'access_intangible_list', 'intangible_list', 'access_intangible_list_intangible'])]
- private $billingPeriodicity;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => true])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['intangible', 'educational_project_intangible_list', 'access_intangible_list', 'intangible_list', 'access_intangible_list_intangible'])]
- private $isActive = true;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'datetime', nullable: true)]
- #[Assert\DateTime]
- #[Groups(['intangible'])]
- private $archiveDate;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 7, nullable: true)]
- #[Assert\Length(max: 7, maxMessage: 'invalid-max-length')]
- #[Assert\Type(type: 'string')]
- #[Groups(['intangible', 'intangible_list', 'access_intangible_list_intangible'])]
- private $accountingCode;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['intangible', 'intangible_list', 'access_intangible_list_intangible'])]
- private $nature;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 200, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['intangible', 'intangible_list', 'access_intangible_list_intangible'])]
- private $accountingCodelabel;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => true])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['intangible', 'access_intangible_list_intangible'])]
- private $applyVat = true;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['intangible', 'intangible_list', 'access_intangible_list_intangible'])]
- private $amountVat;
- /**
- * @var EducationCurriculum
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Education\EducationCurriculum')]
- #[ORM\JoinTable]
- #[Groups(['intangible_educationcurriculum', 'intangible_list', 'access_intangible_list_intangible'])]
- private $educationCurriculums;
- /**
- * @var IntangiblePriceAndDiscount
- */
- #[Assert\Valid]
- #[ORM\OneToOne(targetEntity: 'IntangiblePriceAndDiscount', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['intangible', 'educational_project_intangible_list', 'access_intangible_list', 'intangible_list', 'access_intangible_list_intangible'])]
- private $intangiblePriceAndDiscount;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Education\EducationTypeEnum', 'toArray'])]
- #[Groups(['intangible'])]
- private $domain;
- /**
- * @var ArrayCollection<AccessIntangible>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\AccessIntangible', mappedBy: 'intangible', orphanRemoval: true, cascade: ['persist'])]
- #[Groups(['intangible_accessintangible'])]
- private $accessIntangibles;
- public function __construct()
- {
- parent::__construct();
- $this->educationCurriculums = new ArrayCollection();
- }
- /**
- * Set label
- *
- * @param string $label
- *
- * @return Intangible
- */
- public function setLabel($label)
- {
- $this->label = $label;
- return $this;
- }
- /**
- * Get label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->label;
- }
- /**
- * Set billingPeriodicity
- *
- * @param string $billingPeriodicity
- *
- * @return Intangible
- */
- public function setBillingPeriodicity($billingPeriodicity)
- {
- $this->billingPeriodicity = $billingPeriodicity;
- return $this;
- }
- /**
- * Get billingPeriodicity
- *
- * @return string
- */
- public function getBillingPeriodicity()
- {
- return $this->billingPeriodicity;
- }
- /**
- * Set isActive
- *
- * @param boolean $isActive
- *
- * @return Intangible
- */
- public function setIsActive($isActive)
- {
- $this->isActive = $isActive;
- return $this;
- }
- /**
- * Get isActive
- *
- * @return boolean
- */
- public function getIsActive()
- {
- return $this->isActive;
- }
- /**
- * Set archiveDate
- *
- * @param \DateTime $archiveDate
- *
- * @return Intangible
- */
- public function setArchiveDate($archiveDate)
- {
- $this->archiveDate = $archiveDate;
- return $this;
- }
- /**
- * Get archiveDate
- *
- * @return \DateTime
- */
- public function getArchiveDate()
- {
- return $this->archiveDate;
- }
- /**
- * Set accountingCode
- *
- * @param integer $accountingCode
- *
- * @return Intangible
- */
- public function setAccountingCode($accountingCode)
- {
- $this->accountingCode = $accountingCode;
- return $this;
- }
- /**
- * Get accountingCode
- *
- * @return integer
- */
- public function getAccountingCode()
- {
- return $this->accountingCode;
- }
- /**
- * Set nature
- *
- * @param integer $nature
- *
- * @return Intangible
- */
- public function setNature($nature)
- {
- $this->nature = $nature;
- return $this;
- }
- /**
- * Get nature
- *
- * @return integer
- */
- public function getNature()
- {
- return $this->nature;
- }
- /**
- * Set accountingCodelabel
- *
- * @param string $accountingCodelabel
- *
- * @return Intangible
- */
- public function setAccountingCodelabel($accountingCodelabel)
- {
- $this->accountingCodelabel = $accountingCodelabel;
- return $this;
- }
- /**
- * Get accountingCodelabel
- *
- * @return string
- */
- public function getAccountingCodelabel()
- {
- return $this->accountingCodelabel;
- }
- /**
- * Set applyVat
- *
- * @param boolean $applyVat
- *
- * @return Intangible
- */
- public function setApplyVat($applyVat)
- {
- $this->applyVat = $applyVat;
- return $this;
- }
- /**
- * Get applyVat
- *
- * @return boolean
- */
- public function getApplyVat()
- {
- return $this->applyVat;
- }
- /**
- * Set amountVat
- *
- * @param float $amountVat
- *
- * @return Intangible
- */
- public function setAmountVat($amountVat)
- {
- $this->amountVat = floatval($amountVat);
- return $this;
- }
- /**
- * Get amountVat
- *
- * @return float
- */
- public function getAmountVat()
- {
- return $this->amountVat;
- }
- /**
- * Set intangiblePriceAndDiscount
- *
- * @param \AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount
- *
- * @return Intangible
- */
- public function setIntangiblePriceAndDiscount(\AppBundle\Entity\Product\IntangiblePriceAndDiscount $intangiblePriceAndDiscount = null)
- {
- $this->intangiblePriceAndDiscount = $intangiblePriceAndDiscount;
- return $this;
- }
- /**
- * Get intangiblePriceAndDiscount
- *
- * @return \AppBundle\Entity\Product\IntangiblePriceAndDiscount
- */
- public function getIntangiblePriceAndDiscount()
- {
- return $this->intangiblePriceAndDiscount;
- }
- /**
- * Set billingPeriodicityType
- *
- * @param string $billingPeriodicityType
- *
- * @return Intangible
- */
- public function setBillingPeriodicityType($billingPeriodicityType)
- {
- $this->billingPeriodicityType = $billingPeriodicityType;
- return $this;
- }
- /**
- * Get billingPeriodicityType
- *
- * @return string
- */
- public function getBillingPeriodicityType()
- {
- return $this->billingPeriodicityType;
- }
- /**
- * Add educationalProjectIntangible
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible
- *
- * @return Intangible
- */
- public function addEducationalProjectIntangible(\AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible)
- {
- $this->educationalProjectIntangible[] = $educationalProjectIntangible;
- return $this;
- }
- /**
- * Remove educationalProjectIntangible
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible
- */
- public function removeEducationalProjectIntangible(\AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible)
- {
- $this->educationalProjectIntangible->removeElement($educationalProjectIntangible);
- }
- /**
- * Get educationalProjectIntangible
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationalProjectIntangible()
- {
- return $this->educationalProjectIntangible;
- }
- /**
- * Add educationCurriculum
- *
- * @param \AppBundle\Entity\Education\EducationCurriculum $educationCurriculum
- *
- * @return Intangible
- */
- public function addEducationCurriculum(\AppBundle\Entity\Education\EducationCurriculum $educationCurriculum)
- {
- $this->educationCurriculums[] = $educationCurriculum;
- return $this;
- }
- /**
- * Remove educationCurriculum
- *
- * @param \AppBundle\Entity\Education\EducationCurriculum $educationCurriculum
- */
- public function removeEducationCurriculum(\AppBundle\Entity\Education\EducationCurriculum $educationCurriculum)
- {
- $this->educationCurriculums->removeElement($educationCurriculum);
- }
- /**
- * Get educationCurriculums
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationCurriculums()
- {
- return $this->educationCurriculums;
- }
- /**
- * Set domain
- *
- * @param string $domain
- *
- * @return Intangible
- */
- public function setDomain($domain)
- {
- $this->domain = $domain;
- return $this;
- }
- /**
- * Get domain
- *
- * @return string
- */
- public function getDomain()
- {
- return $this->domain;
- }
- /**
- * Add accessIntangible
- *
- * @param \AppBundle\Entity\Billing\AccessIntangible $accessIntangible
- *
- * @return Intangible
- */
- public function addAccessIntangible(\AppBundle\Entity\Billing\AccessIntangible $accessIntangible)
- {
- $this->accessIntangibles[] = $accessIntangible;
- return $this;
- }
- /**
- * Remove accessIntangible
- *
- * @param \AppBundle\Entity\Billing\AccessIntangible $accessIntangible
- */
- public function removeAccessIntangible(\AppBundle\Entity\Billing\AccessIntangible $accessIntangible)
- {
- $this->accessIntangibles->removeElement($accessIntangible);
- }
- /**
- * Get accessIntangibles
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getAccessIntangibles()
- {
- return $this->accessIntangibles;
- }
- }
|