| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668 |
- <?php
- namespace AppBundle\Entity\Booking;
- use AppBundle\Entity\AccessAndFunction\Access;
- use AppBundle\Entity\Billing\EducationalProjectIntangible;
- use AppBundle\Entity\Product\Equipment;
- 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 OpentalentEvent;
- /**
- * Prestation pédagogique
- *
- * @Iri("http://schema.org/EducationalProject")
- * @OpentalentEvent\EducationnalProject()
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Booking\Repository\EducationalProjectRepository')]
- class EducationalProject extends AbstractBooking
- {
- /**
- * @var ArrayCollection<EducationalProjectRecur>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'EducationalProjectRecur', mappedBy: 'event', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['educationalproject_bookingrecur', 'planning_detail'])]
- protected $eventRecur;
- /**
- * @var ArrayCollection<EducationalProject>
- */
- #[ORM\OneToMany(targetEntity: 'EducationalProject', mappedBy: 'parent', orphanRemoval: true)]
- #[Groups(['educationalproject_timeline'])]
- private $timeline;
- /**
- * @var \AppBundle\Entity\Booking\EducationalProject
- */
- #[ORM\ManyToOne(targetEntity: 'EducationalProject', inversedBy: 'timeline')]
- #[Groups(['educationalproject'])]
- private $parent;
- /**
- * @var string
- */
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectTimelineTypeEnum', 'toArray'], multiple: false, min: 1)]
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Groups(['educationalproject'])]
- private $type;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 35, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $object;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'silentPartners')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $silentPartner;
- /**
- * @var EducationalProjectPublic
- */
- #[ORM\ManyToOne(targetEntity: 'EducationalProjectPublic', inversedBy: 'educationalProjects')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $public;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $amount;
- /**
- * @var EducationalProjectAge
- */
- #[Assert\Valid]
- #[ORM\OneToOne(targetEntity: 'EducationalProjectAge', cascade: ['persist'], orphanRemoval: true, fetch: 'EAGER')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['educationalproject', 'educationalproject_details', 'planning_detail'])]
- private $ageDistribution;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'operationalPartners')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $operationalPartner;
- /**
- * @var Access
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access')]
- #[ORM\JoinTable(name: 'educationalproject_financier')]
- #[Groups(['educationalproject_access', 'planning_detail', 'educationalproject_details'])]
- private $financiers;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectEstablishmentEnum', 'toArray'])]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $establishment;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectSpecialClassEnum', 'toArray'])]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $specialClass;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Booking\EducationalProjectEducationalDeviceEnum', 'toArray'])]
- #[Groups(['educationalproject', 'planning_detail', 'educationalproject_details'])]
- private $educationalDevice;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['educationalproject', 'planning_detail'])]
- private $report;
- /**
- * @var ArrayCollection<File>
- */
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\File')]
- #[Groups(['educationalproject_file'])]
- private $files;
- /**
- * @var ArrayCollection<EducationalProjectIntangible>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\EducationalProjectIntangible', mappedBy: 'educationalProject', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['educationalprojects_educationalprojectintangible', 'planning_detail', 'educationalproject_details'])]
- private $educationalProjectIntangibles;
- /**
- * @var ArrayCollection<EducationalProject>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\EducationalProjectPayer', mappedBy: 'educationalProjectReceiver', cascade: ['persist'], orphanRemoval: true)]
- #[Groups(['educationalproject_educationalprojectpayer', 'planning_detail', 'educationalproject_details'])]
- private $billingReceivers;
- /**
- * @var ArrayCollection<BillLine>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\BillLine', mappedBy: 'educationalProject', orphanRemoval: true)]
- #[Groups(['educationalproject_billline', 'planning_detail'])]
- private $billLines;
- /**
- * var ArrayCollection<AttendanceBooking>
- */
- #[Assert\Valid]
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Booking\AttendanceBooking', cascade: ['persist'], mappedBy: 'educationalProject', orphanRemoval: true)]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['educationalproject_attendancebooking', 'educationalproject_details', 'planning_detail'])]
- private $attendanceBooking;
- public function __construct()
- {
- parent::__construct();
- $this->files = new ArrayCollection();
- $this->financiers = new ArrayCollection();
- $this->educationalProjectIntangibles = new ArrayCollection();
- $this->billingReceivers = new ArrayCollection();
- $this->attendanceBooking = new ArrayCollection();
- }
- /**
- * Sets object.
- *
- * @param string $object
- *
- * @return $this
- */
- public function setObject($object)
- {
- $this->object = $object;
- return $this;
- }
- /**
- * Gets object.
- *
- * @return string
- */
- public function getObject()
- {
- return $this->object;
- }
- /**
- * Sets public.
- *
- * @param EducationalProjectPublic $educationalProjectPublic
- *
- * @return $this
- */
- public function setPublic(EducationalProjectPublic $public = null)
- {
- $this->public = $public;
- return $this;
- }
- /**
- * Gets public.
- *
- * @return EducationalProjectPublic
- */
- public function getPublic()
- {
- return $this->public;
- }
- /**
- * Sets amount.
- *
- * @param float $amount
- *
- * @return $this
- */
- public function setAmount($amount)
- {
- $this->amount = floatval($amount);
- return $this;
- }
- /**
- * Gets amount.
- *
- * @return float
- */
- public function getAmount()
- {
- return $this->amount;
- }
- /**
- * Sets establishment.
- *
- * @param string $establishment
- *
- * @return $this
- */
- public function setEstablishment($establishment)
- {
- $this->establishment = $establishment;
- return $this;
- }
- /**
- * Gets establishment.
- *
- * @return string
- */
- public function getEstablishment()
- {
- return $this->establishment;
- }
- /**
- * Sets specialClass.
- *
- * @param string $specialClass
- *
- * @return $this
- */
- public function setSpecialClass($specialClass)
- {
- $this->specialClass = $specialClass;
- return $this;
- }
- /**
- * Gets specialClass.
- *
- * @return string
- */
- public function getSpecialClass()
- {
- return $this->specialClass;
- }
- /**
- * Sets educationalDevice.
- *
- * @param string $educationalDevice
- *
- * @return $this
- */
- public function setEducationalDevice($educationalDevice)
- {
- $this->educationalDevice = $educationalDevice;
- return $this;
- }
- /**
- * Gets educationalDevice.
- *
- * @return string
- */
- public function getEducationalDevice()
- {
- return $this->educationalDevice;
- }
- /**
- * Sets report.
- *
- * @param string $report
- *
- * @return $this
- */
- public function setReport($report)
- {
- $this->report = $report;
- return $this;
- }
- /**
- * Gets report.
- *
- * @return string
- */
- public function getReport()
- {
- return $this->report;
- }
- /**
- * Set ageDistribution
- *
- * @param \AppBundle\Entity\Booking\EducationalProjectAge $ageDistribution
- *
- * @return EducationalProject
- */
- public function setAgeDistribution(\AppBundle\Entity\Booking\EducationalProjectAge $ageDistribution = null)
- {
- $this->ageDistribution = $ageDistribution;
- return $this;
- }
- /**
- * Get ageDistribution
- *
- * @return \AppBundle\Entity\Booking\EducationalProjectAge
- */
- public function getAgeDistribution()
- {
- return $this->ageDistribution;
- }
- /**
- * Add file
- *
- * @param \AppBundle\Entity\Core\File $file
- *
- * @return EducationalProject
- */
- public function addFile(\AppBundle\Entity\Core\File $file)
- {
- $this->files[] = $file;
- return $this;
- }
- /**
- * Remove file
- *
- * @param \AppBundle\Entity\Core\File $file
- */
- public function removeFile(\AppBundle\Entity\Core\File $file)
- {
- $this->files->removeElement($file);
- }
- /**
- * Get files
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getFiles()
- {
- return $this->files;
- }
- /**
- * Set silentPartner
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $silentPartner
- *
- * @return EducationalProject
- */
- public function setSilentPartner(\AppBundle\Entity\AccessAndFunction\Access $silentPartner = null)
- {
- $this->silentPartner = $silentPartner;
- return $this;
- }
- /**
- * Get silentPartner
- *
- * @return \AppBundle\Entity\AccessAndFunction\Access
- */
- public function getSilentPartner()
- {
- return $this->silentPartner;
- }
- /**
- * Set operationalPartner
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $operationalPartner
- *
- * @return EducationalProject
- */
- public function setOperationalPartner(\AppBundle\Entity\AccessAndFunction\Access $operationalPartner = null)
- {
- $this->operationalPartner = $operationalPartner;
- return $this;
- }
- /**
- * Get operationalPartner
- *
- * @return \AppBundle\Entity\AccessAndFunction\Access
- */
- public function getOperationalPartner()
- {
- return $this->operationalPartner;
- }
- /**
- * Add financier
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $financier
- *
- * @return EducationalProject
- */
- public function addFinancier(\AppBundle\Entity\AccessAndFunction\Access $financier)
- {
- $this->financiers[] = $financier;
- return $this;
- }
- /**
- * Remove financier
- *
- * @param \AppBundle\Entity\AccessAndFunction\Access $financier
- */
- public function removeFinancier(\AppBundle\Entity\AccessAndFunction\Access $financier)
- {
- $this->financiers->removeElement($financier);
- }
- /**
- * Get financiers
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getFinanciers()
- {
- return $this->financiers;
- }
- /**
- * {@inheritdoc}
- */
- public function getParticipants() {
- $participants = new ArrayCollection();
- return $participants;
- }
- /**
- * Set type
- *
- * @param string $type
- *
- * @return EducationalProject
- */
- public function setType($type)
- {
- $this->type = $type;
- return $this;
- }
- /**
- * Get type
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Add timeline
- *
- * @param \AppBundle\Entity\Booking\EducationalProject $timeline
- *
- * @return EducationalProject
- */
- public function addTimeline(\AppBundle\Entity\Booking\EducationalProject $timeline)
- {
- $this->timeline[] = $timeline;
- return $this;
- }
- /**
- * Remove timeline
- *
- * @param \AppBundle\Entity\Booking\EducationalProject $timeline
- */
- public function removeTimeline(\AppBundle\Entity\Booking\EducationalProject $timeline)
- {
- $this->timeline->removeElement($timeline);
- }
- /**
- * Get timeline
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getTimeline()
- {
- return $this->timeline;
- }
- /**
- * Set parent
- *
- * @param \AppBundle\Entity\Booking\EducationalProject $parent
- *
- * @return EducationalProject
- */
- public function setParent(\AppBundle\Entity\Booking\EducationalProject $parent = null)
- {
- $this->parent = $parent;
- return $this;
- }
- /**
- * Get parent
- *
- * @return \AppBundle\Entity\Booking\EducationalProject
- */
- public function getParent()
- {
- return $this->parent;
- }
- /**
- * Add educationalProjectIntangible
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible
- *
- * @return EducationalProject
- */
- public function addEducationalProjectIntangible(\AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible)
- {
- $educationalProjectIntangible->setEducationalProject($this);
- $this->educationalProjectIntangibles[] = $educationalProjectIntangible;
- return $this;
- }
- /**
- * Remove educationalProjectIntangible
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible
- */
- public function removeEducationalProjectIntangible(\AppBundle\Entity\Billing\EducationalProjectIntangible $educationalProjectIntangible)
- {
- $educationalProjectIntangible->setEducationalProject(null);
- $this->educationalProjectIntangibles->removeElement($educationalProjectIntangible);
- }
- /**
- * Get educationalProjectIntangibles
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationalProjectIntangibles()
- {
- return $this->educationalProjectIntangibles;
- }
- /**
- * Add billingReceiver
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectPayer $billingReceiver
- *
- * @return EducationalProject
- */
- public function addBillingReceiver(\AppBundle\Entity\Billing\EducationalProjectPayer $billingReceiver)
- {
- $billingReceiver->setEducationalProjectReceiver($this);
- $this->billingReceivers[] = $billingReceiver;
- return $this;
- }
- /**
- * Remove billingReceiver
- *
- * @param \AppBundle\Entity\Billing\EducationalProjectPayer $billingReceiver
- */
- public function removeBillingReceiver(\AppBundle\Entity\Billing\EducationalProjectPayer $billingReceiver)
- {
- $this->billingReceivers->removeElement($billingReceiver);
- }
- /**
- * Get billingReceivers
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getBillingReceivers()
- {
- return $this->billingReceivers;
- }
- /**
- * Add billLine
- *
- * @param \AppBundle\Entity\Billing\BillLine $billLine
- *
- * @return EducationalProject
- */
- public function addBillLine(\AppBundle\Entity\Billing\BillLine $billLine)
- {
- $this->billLines[] = $billLine;
- return $this;
- }
- /**
- * Remove billLine
- *
- * @param \AppBundle\Entity\Billing\BillLine $billLine
- */
- public function removeBillLine(\AppBundle\Entity\Billing\BillLine $billLine)
- {
- $this->billLines->removeElement($billLine);
- }
- /**
- * Get billLines
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getBillLines()
- {
- return $this->billLines;
- }
- /**
- * Add attendanceBooking
- *
- * @param \AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking
- *
- * @return AbstractBooking
- */
- public function addAttendanceBooking(\AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking)
- {
- $attendanceBooking->setEducationalProject($this);
- $this->attendanceBooking[] = $attendanceBooking;
- return $this;
- }
- /**
- * Remove attendanceBooking
- *
- * @param \AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking
- */
- public function removeAttendanceBooking(\AppBundle\Entity\Booking\AttendanceBooking $attendanceBooking)
- {
- $this->attendanceBooking->removeElement($attendanceBooking);
- }
- /**
- * Get attendanceBooking
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getAttendanceBooking()
- {
- return $this->attendanceBooking;
- }
- }
|