src/Entity/SchoolAverage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\UserRepository;
  5. use App\Repository\SchoolAverageRepository;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. /**
  9.  * @ORM\Entity(repositoryClass=SchoolAverageRepository::class)
  10.  */
  11. class SchoolAverage
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=20, unique=true)
  21.      */
  22.     private $code;
  23.     /**
  24.      * @ORM\Column(type="string", length=128)
  25.      */
  26.     private $label;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="schoolAverages")
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private $establishment;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=SchoolYear::class, inversedBy="schoolAverages")
  34.      * @ORM\JoinColumn(nullable=false)
  35.      */
  36.     private $schoolYear;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=SchoolYearPeriode::class, inversedBy="schoolAverages")
  39.      * @ORM\JoinColumn(nullable=false)
  40.      */
  41.     private $schoolYearPeriode;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=SettingClassroom::class, inversedBy="schoolAverages")
  44.      * @ORM\JoinColumn(nullable=false)
  45.      */
  46.     private $classroom;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=SchoolMatter::class, inversedBy="schoolAverages")
  49.      * @ORM\JoinColumn(nullable=false)
  50.      */
  51.     private $matter;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=SchoolSubMatter::class, inversedBy="schoolAverages")
  54.      */
  55.     private $subMatter;
  56.     /**
  57.      * @ORM\Column(type="float")
  58.      */
  59.     private $note_on;
  60.     /**
  61.      * @ORM\Column(type="float")
  62.      */
  63.     private $coefficient;
  64.     /**
  65.      * @ORM\Column(type="datetime_immutable")
  66.     */
  67.     private $created_at;
  68.     /**
  69.      * @ORM\Column(type="datetime_immutable")
  70.     */
  71.     private $updated_at;
  72.     /**
  73.      * @ORM\Column(type="integer")
  74.     */
  75.     private $created_by;
  76.     /**
  77.      * @ORM\Column(type="integer")
  78.     */
  79.     private $updated_by;
  80.     /**
  81.      * @ORM\OneToMany(targetEntity=SchoolStudentAverage::class, mappedBy="schoolAverage")
  82.      */
  83.     private $schoolStudentAverages;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity=SchoolTeacher::class, inversedBy="schoolAverages")
  86.      * @ORM\JoinColumn(nullable=false)
  87.      */
  88.     private $schoolTeacher;
  89.     /**
  90.      * @ORM\Column(type="boolean")
  91.     */
  92.     private $is_validated;
  93.     /**
  94.      * @ORM\ManyToOne(targetEntity=SchoolTeacherMatterClassroom::class, inversedBy="schoolAverages")
  95.      */
  96.     private $schoolTeacherMatterClassroom;
  97.     public function __construct()
  98.     {
  99.         $this->note_on 20;
  100.         $this->is_validated false;
  101.         $this->coefficient 1;
  102.         $this->schoolStudentAverages = new ArrayCollection();
  103.     }
  104.     public function getId(): ?int
  105.     {
  106.         return $this->id;
  107.     }
  108.     public function getEstablishment(): ?Establishment
  109.     {
  110.         return $this->establishment;
  111.     }
  112.     public function setEstablishment(?Establishment $establishment): self
  113.     {
  114.         $this->establishment $establishment;
  115.         return $this;
  116.     }
  117.     public function getSchoolYear(): ?SchoolYear
  118.     {
  119.         return $this->schoolYear;
  120.     }
  121.     public function setSchoolYear(?SchoolYear $schoolYear): self
  122.     {
  123.         $this->schoolYear $schoolYear;
  124.         return $this;
  125.     }
  126.     public function getSchoolYearPeriode(): ?SchoolYearPeriode
  127.     {
  128.         return $this->schoolYearPeriode;
  129.     }
  130.     public function setSchoolYearPeriode(?SchoolYearPeriode $schoolYearPeriode): self
  131.     {
  132.         $this->schoolYearPeriode $schoolYearPeriode;
  133.         return $this;
  134.     }
  135.     public function getClassroom(): ?SettingClassroom
  136.     {
  137.         return $this->classroom;
  138.     }
  139.     public function setClassroom(?SettingClassroom $classroom): self
  140.     {
  141.         $this->classroom $classroom;
  142.         return $this;
  143.     }
  144.     public function getMatter(): ?SchoolMatter
  145.     {
  146.         return $this->matter;
  147.     }
  148.     public function setMatter(?SchoolMatter $matter): self
  149.     {
  150.         $this->matter $matter;
  151.         return $this;
  152.     }
  153.     public function getSubMatter(): ?SchoolSubMatter
  154.     {
  155.         return $this->subMatter;
  156.     }
  157.     public function setSubMatter(?SchoolSubMatter $subMatter): self
  158.     {
  159.         $this->subMatter $subMatter;
  160.         return $this;
  161.     }
  162.     public function getNoteOn(): ?float
  163.     {
  164.         return $this->note_on;
  165.     }
  166.     public function setNoteOn(float $note_on): self
  167.     {
  168.         $this->note_on $note_on;
  169.         return $this;
  170.     }
  171.     public function getCoefficient(): ?float
  172.     {
  173.         return $this->coefficient;
  174.     }
  175.     public function setCoefficient(float $coefficient): self
  176.     {
  177.         $this->coefficient $coefficient;
  178.         return $this;
  179.     }
  180.     public function getCreatedAt(): ?\DateTimeImmutable
  181.     {
  182.         return $this->created_at;
  183.     }
  184.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  185.     {
  186.         $this->created_at $created_at;
  187.         return $this;
  188.     }
  189.     public function getUpdatedAt(): ?\DateTimeImmutable
  190.     {
  191.         return $this->updated_at;
  192.     }
  193.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  194.     {
  195.         $this->updated_at $updated_at;
  196.         return $this;
  197.     }
  198.     public function getCreatedBy(): ?int
  199.     {
  200.         return $this->created_by;
  201.     }
  202.     public function setCreatedBy(int $created_by): self
  203.     {
  204.         $this->created_by $created_by;
  205.         return $this;
  206.     }
  207.     public function getUpdatedBy(): ?int
  208.     {
  209.         return $this->updated_by;
  210.     }
  211.     public function setUpdatedBy(int $updated_by): self
  212.     {
  213.         $this->updated_by $updated_by;
  214.         return $this;
  215.     }
  216.     /**
  217.      * @return Collection|SchoolStudentAverage[]
  218.      */
  219.     public function getSchoolStudentAverages(): Collection
  220.     {
  221.         return $this->schoolStudentAverages;
  222.     }
  223.     public function addSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
  224.     {
  225.         if (!$this->schoolStudentAverages->contains($schoolStudentAverage)) {
  226.             $this->schoolStudentAverages[] = $schoolStudentAverage;
  227.             $schoolStudentAverage->setSchoolAverage($this);
  228.         }
  229.         return $this;
  230.     }
  231.     public function removeSchoolStudentAverage(SchoolStudentAverage $schoolStudentAverage): self
  232.     {
  233.         if ($this->schoolStudentAverages->removeElement($schoolStudentAverage)) {
  234.             // set the owning side to null (unless already changed)
  235.             if ($schoolStudentAverage->getSchoolAverage() === $this) {
  236.                 $schoolStudentAverage->setSchoolAverage(null);
  237.             }
  238.         }
  239.         return $this;
  240.     }
  241.     public function getSchoolTeacher(): ?SchoolTeacher
  242.     {
  243.         return $this->schoolTeacher;
  244.     }
  245.     public function setSchoolTeacher(?SchoolTeacher $schoolTeacher): self
  246.     {
  247.         $this->schoolTeacher $schoolTeacher;
  248.         return $this;
  249.     }
  250.     public function getIsValidated(): ?bool
  251.     {
  252.         return $this->is_validated;
  253.     }
  254.     public function setIsValidated(bool $is_validated): self
  255.     {
  256.         $this->is_validated $is_validated;
  257.         return $this;
  258.     }
  259.     public function getLabel(): ?string
  260.     {
  261.         return $this->label;
  262.     }
  263.     public function setLabel(string $label): self
  264.     {
  265.         $this->label $label;
  266.         return $this;
  267.     }
  268.     public function getCode(): ?string
  269.     {
  270.         return $this->code;
  271.     }
  272.     public function setCode(string $code): self
  273.     {
  274.         $this->code $code;
  275.         return $this;
  276.     }
  277.     public function getSchoolTeacherMatterClassroom(): ?SchoolTeacherMatterClassroom
  278.     {
  279.         return $this->schoolTeacherMatterClassroom;
  280.     }
  281.     public function setSchoolTeacherMatterClassroom(?SchoolTeacherMatterClassroom $schoolTeacherMatterClassroom): self
  282.     {
  283.         $this->schoolTeacherMatterClassroom $schoolTeacherMatterClassroom;
  284.         return $this;
  285.     }
  286.     public function getUserUpdatedBy(UserRepository $userRepository){
  287.         return $userRepository->findOneBy(['id' => $this->getUpdatedBy()], []);
  288.     }
  289. }