<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\UserRepository;
use App\Repository\SchoolStudentAverageRepository;
/**
* @ORM\Entity(repositoryClass=SchoolStudentAverageRepository::class)
*/
class SchoolStudentAverage
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=20, unique=true)
*/
private $code;
/**
* @ORM\ManyToOne(targetEntity=Establishment::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $establishment;
/**
* @ORM\ManyToOne(targetEntity=SchoolYear::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $schoolYear;
/**
* @ORM\ManyToOne(targetEntity=SchoolYearPeriode::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $schoolYearPeriode;
/**
* @ORM\ManyToOne(targetEntity=RegistrationStudentRegistration::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $registrationStudentRegistration;
/**
* @ORM\ManyToOne(targetEntity=SchoolMatter::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $matter;
/**
* @ORM\ManyToOne(targetEntity=SchoolSubMatter::class, inversedBy="schoolStudentAverages")
*/
private $subMatter;
/**
* @ORM\Column(type="float")
*/
private $note;
/**
* @ORM\Column(type="float")
*/
private $note_on;
/**
* @ORM\Column(type="float")
*/
private $coefficient;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $updated_at;
/**
* @ORM\Column(type="integer")
*/
private $created_by;
/**
* @ORM\Column(type="integer")
*/
private $updated_by;
/**
* @ORM\Column(type="boolean")
*/
private $is_unclassified;
/**
* @ORM\ManyToOne(targetEntity=SchoolAverage::class, inversedBy="schoolStudentAverages")
* @ORM\JoinColumn(nullable=false)
*/
private $schoolAverage;
/**
* @ORM\Column(type="boolean")
*/
private $as_submatter;
/**
* @ORM\Column(type="boolean")
*/
private $is_matter_conduct;
public function __construct()
{
$this->is_matter_conduct = false;
$this->is_unclassified = false;
$this->as_submatter = false;
$this->note = 999;
}
public function getId(): ?int
{
return $this->id;
}
public function getEstablishment(): ?Establishment
{
return $this->establishment;
}
public function setEstablishment(?Establishment $establishment): self
{
$this->establishment = $establishment;
return $this;
}
public function getSchoolYear(): ?SchoolYear
{
return $this->schoolYear;
}
public function setSchoolYear(?SchoolYear $schoolYear): self
{
$this->schoolYear = $schoolYear;
return $this;
}
public function getSchoolYearPeriode(): ?SchoolYearPeriode
{
return $this->schoolYearPeriode;
}
public function setSchoolYearPeriode(?SchoolYearPeriode $schoolYearPeriode): self
{
$this->schoolYearPeriode = $schoolYearPeriode;
return $this;
}
public function getRegistrationStudentRegistration(): ?RegistrationStudentRegistration
{
return $this->registrationStudentRegistration;
}
public function setRegistrationStudentRegistration(?RegistrationStudentRegistration $registrationStudentRegistration): self
{
$this->registrationStudentRegistration = $registrationStudentRegistration;
return $this;
}
public function getMatter(): ?SchoolMatter
{
return $this->matter;
}
public function setMatter(?SchoolMatter $matter): self
{
$this->matter = $matter;
return $this;
}
public function getSubMatter(): ?SchoolSubMatter
{
return $this->subMatter;
}
public function setSubMatter(?SchoolSubMatter $subMatter): self
{
$this->subMatter = $subMatter;
return $this;
}
public function getNote(): ?float
{
return $this->note;
}
public function setNote(float $note): self
{
$this->note = $note;
return $this;
}
public function getNoteOn(): ?float
{
return $this->note_on;
}
public function setNoteOn(float $note_on): self
{
$this->note_on = $note_on;
return $this;
}
public function getCoefficient(): ?float
{
return $this->coefficient;
}
public function setCoefficient(float $coefficient): self
{
$this->coefficient = $coefficient;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeImmutable
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeImmutable $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getCreatedBy(): ?int
{
return $this->created_by;
}
public function setCreatedBy(int $created_by): self
{
$this->created_by = $created_by;
return $this;
}
public function getUpdatedBy(): ?int
{
return $this->updated_by;
}
public function setUpdatedBy(int $updated_by): self
{
$this->updated_by = $updated_by;
return $this;
}
public function getSchoolAverage(): ?SchoolAverage
{
return $this->schoolAverage;
}
public function setSchoolAverage(?SchoolAverage $schoolAverage): self
{
$this->schoolAverage = $schoolAverage;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getIsUnclassified(): ?bool
{
return $this->is_unclassified;
}
public function setIsUnclassified(bool $is_unclassified): self
{
$this->is_unclassified = $is_unclassified;
return $this;
}
public function getAsSubmatter(): ?bool
{
return $this->as_submatter;
}
public function setAsSubmatter(bool $as_submatter): self
{
$this->as_submatter = $as_submatter;
return $this;
}
public function getIsMatterConduct(): ?bool
{
return $this->is_matter_conduct;
}
public function setIsMatterConduct(bool $is_matter_conduct): self
{
$this->is_matter_conduct = $is_matter_conduct;
return $this;
}
public function getUserUpdatedBy(UserRepository $userRepository){
return $userRepository->findOneBy(['id' => $this->getUpdatedBy()], []);
}
}