84 lines
2.0 KiB
PHP
84 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\Common\Collections\ArrayCollection;
|
|
use Doctrine\Common\Collections\Collection;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
|
/**
|
|
* Assignment
|
|
*
|
|
* @ORM\Entity(repositoryClass="App\Repository\AssignmentRepository")
|
|
* @ORM\Table(name="assignment",uniqueConstraints={@ORM\UniqueConstraint(name="unique01", columns={"classroom_id","assignmentteacher_id","assignmentmatter_id"})})
|
|
* @UniqueEntity(fields={"classroom","teacher","matter"}, message="Ce professeur enseigne dèja cette matière dans cette classe")
|
|
*/
|
|
class Assignment
|
|
{
|
|
/**
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Classroom", inversedBy="assignments")
|
|
*/
|
|
private $classroom;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Assignmentteacher", inversedBy="assignments")
|
|
*/
|
|
private $assignmentteacher;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Assignmentmatter", inversedBy="assignments")
|
|
*/
|
|
private $assignmentmatter;
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getClassroom(): ?Classroom
|
|
{
|
|
return $this->classroom;
|
|
}
|
|
|
|
public function setClassroom(?Classroom $classroom): self
|
|
{
|
|
$this->classroom = $classroom;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAssignmentteacher(): ?Assignmentteacher
|
|
{
|
|
return $this->assignmentteacher;
|
|
}
|
|
|
|
public function setAssignmentteacher(?Assignmentteacher $assignmentteacher): self
|
|
{
|
|
$this->assignmentteacher = $assignmentteacher;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAssignmentmatter(): ?Assignmentmatter
|
|
{
|
|
return $this->assignmentmatter;
|
|
}
|
|
|
|
public function setAssignmentmatter(?Assignmentmatter $assignmentmatter): self
|
|
{
|
|
$this->assignmentmatter = $assignmentmatter;
|
|
|
|
return $this;
|
|
}
|
|
|
|
|
|
} |