| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- <?php
- namespace AppBundle\Entity\Education;
- use AppBundle\Entity\Organization\Organization;
- 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;
- use AppBundle\Annotation\DefaultField;
- /**
- * Critère d'évaluation permettant de définir un suivi pédagogique EducationNotation
- *
- * @Iri("http://schema.org/CriteriaNotation")
- */
- #[ORM\Entity]
- class CriteriaNotation
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['criterianotation', 'report_card_educationstudent', 'educationnotation_list', 'criteria_notations_list'])]
- private $id;
- /**
- * @var Organization
- *
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'critereNotations')]
- #[ORM\JoinColumn(nullable: false)]
- #[Assert\NotNull]
- #[Groups(['criterianotation'])]
- private $organization;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string')]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Groups(['criterianotation', 'criterianotation_reference', 'report_card_educationstudent', 'educationnotation_list_criterianotation', 'education_input_list_educationnotations', 'criteria_notations_list'])]
- private $label;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['criterianotation'])]
- private $description;
- /**
- * @var ArrayCollection<EducationNotation>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\EducationNotation', mappedBy: 'criteriaNotation')]
- #[Groups(['criterianotation_educationnotation'])]
- private $educationNotations;
- /**
- * @var bool
- */
- #[ORM\Column(type: 'boolean', options: ['default' => true])]
- #[Assert\Type(type: 'boolean')]
- #[Assert\NotNull]
- #[Groups(['criterianotation', 'criterianotation_reference', 'criteria_notations_list'])]
- private $isActive = true;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', nullable: true)]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Education\TypeCriteriaEnum', 'toArray'], multiple: false)]
- #[Groups(['criterianotation', 'criterianotation_reference', 'educationnotation_list_criterianotation', 'report_card_educationstudent', 'criteria_notations_list'])]
- private $type;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer', nullable: true)]
- #[Assert\Type(type: 'integer', message: 'invalid-integer')]
- #[Assert\GreaterThanOrEqual(value: 0)]
- #[Assert\LessThanOrEqual(value: 100, message: 'lessThanOrEqual100')]
- #[Groups(['criterianotation', 'criterianotation_reference', 'report_card_educationstudent', 'educationnotation_list_criterianotation', 'criteria_notations_list'])]
- private $noteMax;
- /**
- * @var ArrayCollection<EducationNotation>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\CustomNotation', mappedBy: 'criteriaNotation', orphanRemoval: true, cascade: ['persist', 'remove'])]
- #[Groups(['criterianotation', 'criterianotation_reference', 'criteria_notations_list'])]
- private $customNotation;
- /**
- * @var ArrayCollection<EducationNotationCriteriaConfig>
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Education\EducationNotationCriteriaConfig', mappedBy: 'criteriaNotation', orphanRemoval: true, cascade: ['persist', 'remove'])]
- #[Groups(['educationnotationconfig'])]
- private $educationNotationCriteriaConfigs;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->educationNotations = new ArrayCollection();
- $this->customNotation = new ArrayCollection();
- $this->educationNotationCriteriaConfigs = 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 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 description.
- *
- * @param string $description
- *
- * @return $this
- */
- public function setDescription($description)
- {
- $this->description = $description;
- return $this;
- }
- /**
- * Gets description.
- *
- * @return string
- */
- public function getDescription()
- {
- return $this->description;
- }
- /**
- * Add educationNotation
- *
- * @param \AppBundle\Entity\Education\EducationNotation $educationNotation
- *
- * @return CriteriaNotation
- */
- public function addEducationNotation(\AppBundle\Entity\Education\EducationNotation $educationNotation)
- {
- $this->educationNotations[] = $educationNotation;
- return $this;
- }
- /**
- * Remove educationNotation
- *
- * @param \AppBundle\Entity\Education\EducationNotation $educationNotation
- */
- public function removeEducationNotation(\AppBundle\Entity\Education\EducationNotation $educationNotation)
- {
- $this->educationNotations->removeElement($educationNotation);
- }
- /**
- * Get educationNotations
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getEducationNotations()
- {
- return $this->educationNotations;
- }
- /**
- * Set isActive
- *
- * @param boolean $isActive
- *
- * @return CriteriaNotation
- */
- public function setIsActive($isActive)
- {
- $this->isActive = $isActive;
- return $this;
- }
- /**
- * Get isActive
- *
- * @return boolean
- */
- public function getIsActive()
- {
- return $this->isActive;
- }
- /**
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * @param string $type
- */
- public function setType($type)
- {
- $this->type = $type;
- }
- /**
- * @return int
- */
- public function getNoteMax()
- {
- return $this->noteMax;
- }
- /**
- * @param int $noteMax
- */
- public function setNoteMax($noteMax)
- {
- $this->noteMax = $noteMax;
- }
- /**
- * @return CustomNotation
- */
- public function getCustomNotation()
- {
- return $this->customNotation;
- }
- /**
- * Add customNotation
- *
- * @param CustomNotation $customNotation
- *
- * @return CriteriaNotation
- */
- public function addCustomNotation(CustomNotation $customNotation)
- {
- $customNotation->setCriteriaNotation($this);
- $this->customNotation[] = $customNotation;
- return $this;
- }
- /**
- * Remove customNotation
- *
- * @param CustomNotation $customNotation
- */
- public function removeCustomNotation(CustomNotation $customNotation)
- {
- $customNotation->setCriteriaNotation(null);
- $this->customNotation->removeElement($customNotation);
- }
- /**
- * @return ArrayCollection<EducationNotationCriteriaConfig>
- *
- */
- public function getEducationNotationCriteriaConfigs()
- {
- return $this->educationNotationCriteriaConfigs;
- }
- /**
- * Add educationNotationCriteriaConfig
- *
- * @param EducationNotationCriteriaConfig $educationNotationCriteriaConfigs
- *
- * @return CriteriaNotation
- */
- public function addEducationNotationCriteriaConfig(EducationNotationCriteriaConfig $educationNotationCriteriaConfigs)
- {
- $educationNotationCriteriaConfigs->setCriteriaNotation($this);
- $this->educationNotationCriteriaConfigs[] = $educationNotationCriteriaConfigs;
- return $this;
- }
- /**
- * Remove educationNotationCriteriaConfig
- *
- * @param EducationNotationCriteriaConfig $educationNotationCriteriaConfigs
- */
- public function removeEducationNotationCriteriaConfig(EducationNotationCriteriaConfig $educationNotationCriteriaConfigs)
- {
- $educationNotationCriteriaConfigs->setCriteriaNotation(null);
- $this->educationNotationCriteriaConfigs->removeElement($educationNotationCriteriaConfigs);
- }
- }
|