| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- <?php
- namespace AppBundle\Entity\Education;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Annotation\DefaultField;
- use AppBundle\Enum\Cycle\CycleEnum;
- 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;
- /**
- * Enum des cycles édcatifs, utilisés par les EducationCurriculum
- * NB: le nombre de cycles est fixé à 6, mais chaque Organization peut en modifier le label
- *
- * @Iri("http://schema.org/Cycle")
- */
- #[ORM\Entity]
- class Cycle
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['cycle', 'cycle_reference', 'educationcurriculum_reference', 'planning_list', 'access_details_practicalcourses', 'student_list_courses', 'educationstudent_reference_educationcurriculum', 'cycle_read', 'cycle_edit'])]
- private $id;
- /**
- * @var Organization
- *
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'cycles')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['cycle'])]
- private $organization;
- /**
- * @var integer
- */
- #[ORM\Column(name: '`order`', type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Groups(['cycle'])]
- private $order;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string')]
- #[Assert\Type(type: 'string')]
- #[Groups(['cycle', 'educationcurriculum_reference_cycle', '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', 'cycle_reference', 'access_details_educationstudent', 'edu_stu_courses_courses', 'student_registration_courses', 'educationnotation_list_educationstudent', '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', 'cycle_read', 'cycle_edit'])]
- private $label;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string')]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Cycle\CycleEnum', 'toArray'])]
- #[Groups(['cycle', 'cycle_read'])]
- private $cycleEnum;
- /**
- * @var bool
- */
- #[Assert\Type(type: 'boolean')]
- #[ORM\Column(type: 'boolean', nullable: true, options: ['default' => false])]
- #[Groups(['cycle', 'cycle_read'])]
- private $isSystem;
- /**
- * @var ArrayCollection<CycleByEducation>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\CycleByEducation', mappedBy: 'cycle', orphanRemoval: true)]
- #[Groups(['cycle_cyclebyeducation'])]
- private $cycleByEducations;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->cycleByEducations = new ArrayCollection();
- }
- /**
- * 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 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 order.
- *
- * @param integer $order
- *
- * @return $this
- */
- public function setOrder($order)
- {
- $this->order = $order;
- return $this;
- }
- /**
- * Gets order.
- *
- * @return integer
- */
- public function getOrder()
- {
- return $this->order;
- }
- /**
- * Sets label.
- *
- * @param string $label
- *
- * @return $this
- */
- public function setLabel($label)
- {
- $this->label = $label;
- return $this;
- }
- /**
- * Gets label.
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->label;
- }
- /**
- * Sets cycleEnum.
- *
- * @param string $cycleEnum
- *
- * @return $this
- */
- public function setCycleEnum($cycleEnum)
- {
- $this->cycleEnum = $cycleEnum;
- return $this;
- }
- /**
- * Gets cycleEnum.
- *
- * @return string
- */
- public function getCycleEnum()
- {
- return $this->cycleEnum;
- }
- /**
- * Sets isSystem.
- *
- * @param bool $isSystem
- *
- * @return $this
- */
- public function setIsSystem($isSystem)
- {
- $this->isSystem = $isSystem;
- return $this;
- }
- /**
- * Gets isSystem.
- *
- * @return bool
- */
- public function getIsSystem()
- {
- return $this->isSystem;
- }
- /**
- * Add cycleByEducation
- *
- * @param \AppBundle\Entity\Education\CycleByEducation $cycleByEducation
- *
- * @return Cycle
- */
- public function addCycleByEducation(\AppBundle\Entity\Education\CycleByEducation $cycleByEducation)
- {
- $this->cycleByEducations[] = $cycleByEducation;
- return $this;
- }
- /**
- * Remove cycleByEducation
- *
- * @param \AppBundle\Entity\Education\CycleByEducation $cycleByEducation
- */
- public function removeCycleByEducation(\AppBundle\Entity\Education\CycleByEducation $cycleByEducation)
- {
- $this->cycleByEducations->removeElement($cycleByEducation);
- }
- /**
- * Get cycleByEducations
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getCycleByEducations()
- {
- return $this->cycleByEducations;
- }
- }
|