| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- <?php
- namespace AppBundle\Entity\Education;
- use AppBundle\Annotation\EntityJson;
- use AppBundle\Annotation\ExportSplitFields;
- use AppBundle\Entity\Booking\Examen;
- use AppBundle\Enum\Education\PratiqueEnum;
- use AppBundle\Enum\Product\ProductGroupEnum;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Enum\Core\YearEnum;
- 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\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Curriculum éducatif; composé d'un cycle, d'une année et d'un niveau
- *
- * @Iri("http://schema.org/EducationCurriculum")
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Education\Repository\EducationCurriculumRepository')]
- class EducationCurriculum
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- private $legacyId;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['educationcurriculum', 'intangible_list', 'my_student_list', 'planning_list', 'access_details_practicalcourses', 'presence_attendance', 'planning_detail', 'examen_details', 'course_details', 'educationstudent_reference', 'edu_stu_courses_courses', 'student_registration_courses', 'education_edit', 'examenconvocation_list_student', 'education_student_next_year', 'education_input_list', 'educationstudent_notation', 'educations_quotas_stats'])]
- private $id;
- /**
- * @var Education education
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\Education', inversedBy: 'educationCurriculums')]
- #[Assert\NotNull]
- #[Groups(['educationcurriculum', 'access_details_educationstudent', 'educationcurriculum_reference', 'student_list_educationstudent', 'student_list_courses', 'intangible_list_educationcurriculums', 'my_student_list_educationcurriculum', 'report_card_educationstudent', 'access_details_practicalcourses', 'educationstudent_reference_educationcurriculum', 'educationstudent_notation_educationcurriculum', 'educationcurriculum_reference', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', 'examenconvocation_list_student', 'accesses_courseteacher_show_practicalcourses', 'education_input_list_educationcurriculum', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'online_registration_access_details_educationstudent', 'access_intangible_list_intangible', 'accesses_no_reregistred_list_educationstudent'])]
- private $education;
- /**
- * @var string
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\Cycle')]
- #[Groups(['educationcurriculum', 'educationcurriculum_reference', 'access_details_educationstudent', 'student_list_educationstudent', 'intangible_list_educationcurriculums', 'my_student_list_educationcurriculum', 'planning_list', 'attendancebooking_list_course', 'generate_attendance', 'report_card_educationstudent', 'access_details_practicalcourses', 'presence_attendance_educationcurriculum', 'student_list_courses', 'examen_details_educationcurriculum', 'course_details_educationcurriculum', 'educationstudent_reference_educationcurriculum', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', 'education_edit_educationcurriculums', 'examenconvocation_list_examen', 'accesses_courseteacher_show_practicalcourses', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'education_input_list_educationcurriculum', 'access_intangible_list_intangible', 'worksbyusers_db_work', 'educationstudent_notation_educationcurriculum', 'accesses_no_reregistred_list_educationstudent'])]
- private $cycle;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Education\YearEnum', 'toArray'])]
- #[Groups(['educationcurriculum', 'educationcurriculum_reference', 'access_details_educationstudent', 'student_list_educationstudent', 'intangible_list_educationcurriculums', 'examenconvocation_list_examen', 'my_student_list_educationcurriculum', 'planning_list', 'attendancebooking_list_course', 'generate_attendance', 'report_card_educationstudent', 'access_details_practicalcourses', 'presence_attendance_educationcurriculum', 'student_list_courses', 'examen_details_educationcurriculum', 'course_details_educationcurriculum', 'educationstudent_reference_educationcurriculum', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', 'education_edit_educationcurriculums', 'accesses_courseteacher_show_practicalcourses', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'education_input_list_educationcurriculum', 'access_intangible_list_intangible', 'worksbyusers_db_work', 'educationstudent_notation_educationcurriculum', 'accesses_no_reregistred_list_educationstudent'])]
- private $year;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 25, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['educationcurriculum', 'educationcurriculum_reference', 'access_details_educationstudent', 'student_list_educationstudent', 'planning_list', 'report_card_educationstudent', 'access_details_practicalcourses', 'presence_attendance_educationcurriculum', 'student_list_courses', 'examen_details_educationcurriculum', 'course_details_educationcurriculum', 'educationstudent_reference_educationcurriculum', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', 'education_edit_educationcurriculums', 'examenconvocation_list_examen', 'accesses_courseteacher_show_practicalcourses', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'education_input_list_educationcurriculum', 'access_intangible_list_intangible', 'worksbyusers_db_work', 'educationstudent_notation_educationcurriculum', 'accesses_no_reregistred_list_educationstudent'])]
- private $level;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['educationcurriculum'])]
- private $endDate;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => false])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['educationcurriculum', 'education_edit_educationcurriculums'])]
- private $isDisabled = false;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => true])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['educationcurriculum', 'education_edit_educationcurriculums'])]
- private $isActive = true;
- /**
- * @var integer
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['educationcurriculum'])]
- private $duration;
- /**
- * @var integer
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['educationcurriculum'])]
- private $nbStudentsMax;
- /**
- * @var integer
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['educationcurriculum'])]
- private $nbStudentsByCourse;
- /**
- * @var integer
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['educationcurriculum'])]
- private $packingRate;
- /**
- * @var ArrayCollection<EducationStudent>
- */
- #[ORM\OneToMany(targetEntity: 'EducationStudent', mappedBy: 'educationCurriculum', cascade: ['persist'])]
- #[Groups(['education_educationstudent'])]
- private $educationStudent;
- /**
- * @var integer
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer')]
- #[Groups(['education_edit_educationcurriculums', 'educationcurriculum', 'educations_quotas_stats_educationcurriculums'])]
- private $availablePlaces;
- /**
- * @var integer
- */
- #[Groups(['educations_quotas_stats_educationcurriculums'])]
- private $totalEducationStudents;
- /**
- * @var integer
- */
- #[Groups(['educations_quotas_stats_educationcurriculums'])]
- private $fillingRate;
- /**
- * @var integer
- */
- #[Groups(['educations_quotas_stats_educationcurriculums'])]
- private $order;
- /**
- * @var string
- * @ExportSplitFields({"education.educationCategory.label","education.educationComplementTemplate","cycle.label","year","level"})
- */
- #[Groups(['intangible_list_educationcurriculums', 'planning_detail_educationcurriculum', 'educationcurriculum', 'student_list_educationstudent', 'educationnotation_list_educationstudent', 'education_student_next_year_educationcurriculum', 'education_student_next_year_educationstudentlastyear', 'education_input_list_educationcurriculum', 'access_intangible_list_intangible', 'educations_quotas_stats_educationcurriculums'])]
- private $fullLabelTemplate;
- /**
- * @var string
- * @ExportSplitFields({"cycle.label","year","level"})
- */
- #[Groups(['examenconvocation_list_examen'])]
- private $cycleYearLevelTemplate;
- /**
- * Only for elasticsearch...
- * @var string
- */
- private $fullLabelElastic;
- /**
- * @var EducationNotationConfig
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Education\EducationNotationConfig', inversedBy: 'educationCurriculums')]
- #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
- #[Groups(['educationcurriculum', 'educationcurriculum_reference'])]
- private $educationNotationConfig;
- #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Education\EducationTiming', inversedBy: 'educationCurriculums')]
- #[ORM\JoinTable(joinColumns: [], inverseJoinColumns: [])]
- #[ORM\JoinColumn(name: 'educationCurriculum_id', referencedColumnName: 'id')]
- #[ORM\JoinColumn(name: 'educationTiming_id', referencedColumnName: 'id')]
- #[Groups(['education_edit_educationcurriculums', 'educationcurriculum', 'educationcurriculum_reference'])]
- private $educationTimings;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->educationStudent = new ArrayCollection();
- $this->educationTimings = new ArrayCollection();
- }
- /**
- * Sets legacyId.
- *
- * @param string $legacyId
- *
- * @return $this
- */
- public function setLegacyId($legacyId)
- {
- $this->legacyId = $legacyId;
- return $this;
- }
- /**
- * Gets legacyId.
- *
- * @return string
- */
- public function getLegacyId()
- {
- return $this->legacyId;
- }
- /**
- * 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 education.
- *
- * @param Education $education
- *
- * @return $this
- */
- public function setEducation($education)
- {
- $this->education = $education;
- return $this;
- }
- /**
- * Gets education.
- *
- * @return Education
- */
- public function getEducation()
- {
- return $this->education;
- }
- /**
- * Sets cycle.
- *
- * @param string $cycle
- *
- * @return $this
- */
- public function setCycle($cycle)
- {
- $this->cycle = $cycle;
- return $this;
- }
- /**
- * Gets cycle.
- *
- * @return string
- */
- public function getCycle()
- {
- return $this->cycle;
- }
- /**
- * Sets year.
- *
- * @param integer $year
- *
- * @return $this
- */
- public function setYear($year)
- {
- $this->year = $year;
- return $this;
- }
- /**
- * Gets year.
- *
- * @return integer
- */
- public function getYear()
- {
- return $this->year;
- }
- /**
- * Sets level.
- *
- * @param string $level
- *
- * @return $this
- */
- public function setLevel($level)
- {
- $this->level = $level;
- return $this;
- }
- /**
- * Gets level.
- *
- * @return string
- */
- public function getLevel()
- {
- return $this->level;
- }
- /**
- * Sets endDate.
- *
- * @param \DateTime $endDate
- *
- * @return $this
- */
- public function setEndDate(\DateTime $endDate = null)
- {
- $this->endDate = $endDate;
- return $this;
- }
- /**
- * Gets endDate.
- *
- * @return \DateTime
- */
- public function getEndDate()
- {
- return $this->endDate ? $this->endDate->format('Y-m-d') : $this->endDate;
- }
- /**
- * Set isActive
- *
- * @param boolean $isActive
- *
- * @return CycleByNotation
- */
- public function setIsActive($isActive)
- {
- $this->isActive = $isActive;
- return $this;
- }
- /**
- * Get isActive
- *
- * @return boolean
- */
- public function getIsActive()
- {
- return $this->isActive;
- }
- /**
- * @param $isDisabled
- * @return $this
- */
- public function setIsDisabled($isDisabled)
- {
- $this->isDisabled = $isDisabled;
- return $this;
- }
- /**
- * @return bool
- */
- public function getIsDisabled()
- {
- return $this->isDisabled;
- }
- /**
- * Sets duration.
- *
- * @param integer $duration
- *
- * @return $this
- */
- public function setDuration($duration)
- {
- $this->duration = $duration;
- return $this;
- }
- /**
- * Gets duration.
- *
- * @return integer
- */
- public function getDuration()
- {
- return $this->duration;
- }
- /**
- * Sets nb students max.
- *
- * @param integer $nbStudentsMax
- *
- * @return $this
- */
- public function setNbStudentsMax($nbStudentsMax)
- {
- $this->nbStudentsMax = $nbStudentsMax;
- return $this;
- }
- /**
- * Gets nbStudentsMax.
- *
- * @return integer
- */
- public function getNbStudentsMax()
- {
- return $this->nbStudentsMax;
- }
- /**
- * Sets nbStudentsByCourse.
- *
- * @param integer $nbStudentsByCourse
- *
- * @return $this
- */
- public function setNbStudentsByCourse($nbStudentsByCourse)
- {
- $this->nbStudentsByCourse = $nbStudentsByCourse;
- return $this;
- }
- /**
- * Gets nbStudentsByCourse.
- *
- * @return integer
- */
- public function getNbStudentsByCourse()
- {
- return $this->nbStudentsByCourse;
- }
- /**
- * Gets packingRate.
- *
- * @return integer
- */
- public function getPackingRate()
- {
- return $this->packingRate;
- }
- /**
- * Set packingRate
- *
- * @param integer $packingRate
- *
- * @return EducationCurriculum
- */
- public function setPackingRate($packingRate)
- {
- $this->packingRate = $packingRate;
- return $this;
- }
- /**
- * Add educationStudent
- *
- * @param \AppBundle\Entity\Education\EducationStudent $educationStudent
- *
- * @return EducationCurriculum
- */
- public function addEducationStudent(\AppBundle\Entity\Education\EducationStudent $educationStudent)
- {
- $this->educationStudent[] = $educationStudent;
- return $this;
- }
- /**
- * Remove educationStudent
- *
- * @param \AppBundle\Entity\Education\EducationStudent $educationStudent
- */
- public function removeEducationStudent(\AppBundle\Entity\Education\EducationStudent $educationStudent)
- {
- $this->educationStudent->removeElement($educationStudent);
- }
- /**
- * Get educationStudent
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationStudent()
- {
- return $this->educationStudent;
- }
- /**
- * Gets full label.
- *
- * @return array
- */
- public function getFullLabelTemplate()
- {
- return [
- $this->getEducation()->getEducationCategory()->getLabel(),
- $this->getEducation()->getEducationComplementTemplate(),
- $this->getCycle() && $this->getCycle()->getLabel() !== 'NO_CYCLE' ? $this->getCycle()->getLabel() : '',
- ['value' => $this->getYear(), 'translate' => true],
- $this->getLevel()
- ];
- }
- /**
- * Gets full label.
- *
- * @return array
- */
- public function getCycleYearLevelTemplate()
- {
- return [
- $this->getCycle() && $this->getCycle()->getLabel() !== 'NO_CYCLE' ? $this->getCycle()->getLabel() : '',
- ['value' => $this->getYear(), 'translate' => true],
- $this->getLevel()
- ];
- }
- /**
- * Gets full label.
- *
- * @return array
- */
- public function getFullLabelElastic()
- {
- return $this->getLevel();
- }
- /**
- * Set availablePlaces
- *
- * @param integer $availablePlaces
- *
- * @return EducationCurriculum
- */
- public function setAvailablePlaces($availablePlaces)
- {
- $this->availablePlaces = $availablePlaces;
- return $this;
- }
- /**
- * Get availablePlaces
- *
- * @return integer
- */
- public function getAvailablePlaces()
- {
- return $this->availablePlaces;
- }
- /**
- * Set totalEducationStudents
- *
- * @param integer $totalEducationStudents
- *
- * @return EducationCurriculum
- */
- public function setTotalEducationStudents($totalEducationStudents)
- {
- $this->totalEducationStudents = $totalEducationStudents;
- return $this;
- }
- /**
- * Get totalEducationStudents
- *
- * @return integer
- */
- public function getTotalEducationStudents()
- {
- return $this->totalEducationStudents;
- }
- /**
- * Set $fillingRate
- *
- * @param integer $fillingRate
- *
- * @return EducationCurriculum
- */
- public function setFillingRate($fillingRate)
- {
- $this->fillingRate = $fillingRate;
- return $this;
- }
- /**
- * Get $fillingRate
- *
- * @return integer
- */
- public function getFillingRate()
- {
- return $this->fillingRate;
- }
- /**
- * Set $order
- *
- * @param integer $order
- *
- * @return EducationCurriculum
- */
- public function setOrder($order)
- {
- $this->order = $order;
- return $this;
- }
- /**
- * Get $order
- *
- * @return integer
- */
- public function getOrder()
- {
- return $this->order;
- }
- /**
- * Sets educationNotationConfig.
- *
- * @param $educationNotationConfig
- *
- * @return $this
- */
- public function setEducationNotationConfig($educationNotationConfig)
- {
- $this->educationNotationConfig = $educationNotationConfig;
- return $this;
- }
- /**
- * Gets educationNotationConfig.
- *
- * @return EducationNotationConfig
- */
- public function getEducationNotationConfig()
- {
- return $this->educationNotationConfig;
- }
- /**
- * Add $educationTiming
- *
- * @param \AppBundle\Entity\Education\EducationTiming $educationTiming
- *
- * @return EducationCurriculum
- */
- public function addEducationTiming(\AppBundle\Entity\Education\EducationTiming $educationTiming)
- {
- $this->educationTimings[] = $educationTiming;
- return $this;
- }
- /**
- * Remove $educationTiming
- *
- * @param \AppBundle\Entity\Education\EducationTiming $educationTiming
- */
- public function removeEducationTiming(\AppBundle\Entity\Education\EducationTiming $educationTiming)
- {
- /** @var EducationStudent $educationStudent */
- foreach ($this->getEducationStudent() as $educationStudent){
- if($educationStudent->getEducationTiming() && $educationStudent->getEducationTiming()->getId() === $educationTiming->getId()){
- $educationStudent->setEducationTiming(null);
- }
- }
- $this->educationTimings->removeElement($educationTiming);
- }
- /**
- * Get EducationTiming
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationTimings()
- {
- return $this->educationTimings;
- }
- }
|