src/Entity/ReportCard.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReportCardRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ReportCardRepository::class)
  9.  */
  10. class ReportCard
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=60, unique=true)
  20.      */
  21.     private $code;
  22.     /**
  23.      * @ORM\Column(type="string", length=128)
  24.      */
  25.     private $label;
  26.     /**
  27.      * @ORM\Column(type="float")
  28.      */
  29.     private $note_on;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="reportCards")
  32.      * @ORM\JoinColumn(nullable=false)
  33.      */
  34.     private $establishment;
  35.     /**
  36.      * @ORM\ManyToOne(targetEntity=SchoolYear::class, inversedBy="reportCards")
  37.      * @ORM\JoinColumn(nullable=false)
  38.      */
  39.     private $schoolYear;
  40.     /**
  41.      * @ORM\ManyToOne(targetEntity=SchoolYearPeriode::class, inversedBy="reportCards")
  42.      * @ORM\JoinColumn(nullable=false)
  43.      */
  44.     private $schoolYearPeriode;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity=SettingLevel::class, inversedBy="reportCards")
  47.      * @ORM\JoinColumn(nullable=false)
  48.      */
  49.     private $level;
  50.     /**
  51.      * @ORM\Column(type="float")
  52.      */
  53.     private $coefficient;
  54.     /**
  55.      * @ORM\Column(type="integer")
  56.      */
  57.     private $order_num;
  58.     /**
  59.      * @ORM\Column(type="datetime_immutable")
  60.     */
  61.     private $created_at;
  62.     /**
  63.      * @ORM\Column(type="datetime_immutable")
  64.      */
  65.     private $updated_at;
  66.     /**
  67.      * @ORM\Column(type="integer")
  68.      */
  69.     private $created_by;
  70.     /**
  71.      * @ORM\Column(type="integer")
  72.      */
  73.     private $updated_by;
  74.     /**
  75.      * @ORM\OneToMany(targetEntity=SchoolReportCard::class, mappedBy="reportCard")
  76.      */
  77.     private $schoolReportCards;
  78.     /**
  79.      * @ORM\Column(type="boolean")
  80.     */
  81.     private $is_validated;
  82.     /**
  83.      * @ORM\Column(type="float", nullable=true)
  84.      */
  85.     private $report_card_average;
  86.     /**
  87.      * @ORM\Column(type="float", nullable=true)
  88.      */
  89.     private $level_average;
  90.     /**
  91.      * @ORM\Column(type="float", nullable=true)
  92.      */
  93.     private $smallest_average;
  94.     /**
  95.      * @ORM\Column(type="float", nullable=true)
  96.      */
  97.     private $strongest_average;
  98.     /**
  99.      * @ORM\OneToMany(targetEntity=SchoolAssessment::class, mappedBy="reportCard")
  100.      */
  101.     private $schoolAssessments;
  102.     public function __construct()
  103.     {
  104.         $this->order_num time();
  105.         $this->label 'BULLETIN DE NOTES :';
  106.         $this->note_on 20;
  107.         $this->is_validated false;
  108.         $this->coefficient 1;
  109.         $this->schoolReportCards = new ArrayCollection();
  110.         $this->schoolAssessments = new ArrayCollection();
  111.     }
  112.     public function __toString()
  113.     {
  114.         return $this->getLabel().' '.$this->getSchoolYearPeriode()->getLabel().' - '.$this->getLevel()->getLabel();
  115.     }
  116.     public function getId(): ?int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function getEstablishment(): ?Establishment
  121.     {
  122.         return $this->establishment;
  123.     }
  124.     public function setEstablishment(?Establishment $establishment): self
  125.     {
  126.         $this->establishment $establishment;
  127.         return $this;
  128.     }
  129.     public function getSchoolYear(): ?SchoolYear
  130.     {
  131.         return $this->schoolYear;
  132.     }
  133.     public function setSchoolYear(?SchoolYear $schoolYear): self
  134.     {
  135.         $this->schoolYear $schoolYear;
  136.         return $this;
  137.     }
  138.     public function getSchoolYearPeriode(): ?SchoolYearPeriode
  139.     {
  140.         return $this->schoolYearPeriode;
  141.     }
  142.     public function setSchoolYearPeriode(?SchoolYearPeriode $schoolYearPeriode): self
  143.     {
  144.         $this->schoolYearPeriode $schoolYearPeriode;
  145.         return $this;
  146.     }
  147.     public function getLevel(): ?SettingLevel
  148.     {
  149.         return $this->level;
  150.     }
  151.     public function setLevel(?SettingLevel $level): self
  152.     {
  153.         $this->level $level;
  154.         return $this;
  155.     }
  156.     public function getCoefficient(): ?float
  157.     {
  158.         return $this->coefficient;
  159.     }
  160.     public function setCoefficient(float $coefficient): self
  161.     {
  162.         $this->coefficient $coefficient;
  163.         return $this;
  164.     }
  165.     public function getOrderNum(): ?int
  166.     {
  167.         return $this->order_num;
  168.     }
  169.     public function setOrderNum(int $order_num): self
  170.     {
  171.         $this->order_num $order_num;
  172.         return $this;
  173.     }
  174.     /**
  175.      * @return Collection|SchoolReportCard[]
  176.      */
  177.     public function getSchoolReportCards(): Collection
  178.     {
  179.         return $this->schoolReportCards;
  180.     }
  181.     public function addSchoolReportCard(SchoolReportCard $schoolReportCard): self
  182.     {
  183.         if (!$this->schoolReportCards->contains($schoolReportCard)) {
  184.             $this->schoolReportCards[] = $schoolReportCard;
  185.             $schoolReportCard->setReportCard($this);
  186.         }
  187.         return $this;
  188.     }
  189.     public function removeSchoolReportCard(SchoolReportCard $schoolReportCard): self
  190.     {
  191.         if ($this->schoolReportCards->removeElement($schoolReportCard)) {
  192.             // set the owning side to null (unless already changed)
  193.             if ($schoolReportCard->getReportCard() === $this) {
  194.                 $schoolReportCard->setReportCard(null);
  195.             }
  196.         }
  197.         return $this;
  198.     }
  199.     public function getCode(): ?string
  200.     {
  201.         return $this->code;
  202.     }
  203.     public function setCode(string $code): self
  204.     {
  205.         $this->code $code;
  206.         return $this;
  207.     }
  208.     public function getLabel(): ?string
  209.     {
  210.         return $this->label;
  211.     }
  212.     public function setLabel(string $label): self
  213.     {
  214.         $this->label $label;
  215.         return $this;
  216.     }
  217.     public function getCreatedAt(): ?\DateTimeImmutable
  218.     {
  219.         return $this->created_at;
  220.     }
  221.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  222.     {
  223.         $this->created_at $created_at;
  224.         return $this;
  225.     }
  226.     public function getUpdatedAt(): ?\DateTimeImmutable
  227.     {
  228.         return $this->updated_at;
  229.     }
  230.     public function setUpdatedAt(\DateTimeImmutable $updated_at): self
  231.     {
  232.         $this->updated_at $updated_at;
  233.         return $this;
  234.     }
  235.     public function getCreatedBy(): ?int
  236.     {
  237.         return $this->created_by;
  238.     }
  239.     public function setCreatedBy(int $created_by): self
  240.     {
  241.         $this->created_by $created_by;
  242.         return $this;
  243.     }
  244.     public function getUpdatedBy(): ?int
  245.     {
  246.         return $this->updated_by;
  247.     }
  248.     public function setUpdatedBy(int $updated_by): self
  249.     {
  250.         $this->updated_by $updated_by;
  251.         return $this;
  252.     }
  253.     public function getIsValidated(): ?bool
  254.     {
  255.         return $this->is_validated;
  256.     }
  257.     public function setIsValidated(bool $is_validated): self
  258.     {
  259.         $this->is_validated $is_validated;
  260.         return $this;
  261.     }
  262.     public function getNoteOn(): ?float
  263.     {
  264.         return $this->note_on;
  265.     }
  266.     public function setNoteOn(float $note_on): self
  267.     {
  268.         $this->note_on $note_on;
  269.         return $this;
  270.     }
  271.     public function getReportCardAverage(): ?float
  272.     {
  273.         return $this->report_card_average;
  274.     }
  275.     public function setReportCardAverage(?float $report_card_average): self
  276.     {
  277.         $this->report_card_average $report_card_average;
  278.         return $this;
  279.     }
  280.     public function getLevelAverage(): ?float
  281.     {
  282.         return $this->level_average;
  283.     }
  284.     public function setLevelAverage(?float $level_average): self
  285.     {
  286.         $this->level_average $level_average;
  287.         return $this;
  288.     }
  289.     public function getSmallestAverage(): ?float
  290.     {
  291.         return $this->smallest_average;
  292.     }
  293.     public function setSmallestAverage(?float $smallest_average): self
  294.     {
  295.         $this->smallest_average $smallest_average;
  296.         return $this;
  297.     }
  298.     public function getStrongestAverage(): ?float
  299.     {
  300.         return $this->strongest_average;
  301.     }
  302.     public function setStrongestAverage(?float $strongest_average): self
  303.     {
  304.         $this->strongest_average $strongest_average;
  305.         return $this;
  306.     }
  307.     /**
  308.      * @return Collection|SchoolAssessment[]
  309.      */
  310.     public function getSchoolAssessments(): Collection
  311.     {
  312.         return $this->schoolAssessments;
  313.     }
  314.     public function addSchoolAssessment(SchoolAssessment $schoolAssessment): self
  315.     {
  316.         if (!$this->schoolAssessments->contains($schoolAssessment)) {
  317.             $this->schoolAssessments[] = $schoolAssessment;
  318.             $schoolAssessment->setReportCard($this);
  319.         }
  320.         return $this;
  321.     }
  322.     public function removeSchoolAssessment(SchoolAssessment $schoolAssessment): self
  323.     {
  324.         if ($this->schoolAssessments->removeElement($schoolAssessment)) {
  325.             // set the owning side to null (unless already changed)
  326.             if ($schoolAssessment->getReportCard() === $this) {
  327.                 $schoolAssessment->setReportCard(null);
  328.             }
  329.         }
  330.         return $this;
  331.     }
  332. }