141 lines
2.8 KiB
PHP
141 lines
2.8 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;
|
|
|
|
/**
|
|
* Control
|
|
*
|
|
* @ORM\Entity(repositoryClass="App\Repository\ControlRepository")
|
|
* @ORM\Table(name="control")
|
|
*/
|
|
class Control
|
|
{
|
|
/**
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @ORM\Column(name="name", type="string")
|
|
*
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @ORM\Column(type="datetime", nullable=true)
|
|
*/
|
|
private $datestart;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Period", inversedBy="controls")
|
|
*/
|
|
private $period;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="Assignmentmatter", inversedBy="controls")
|
|
*/
|
|
private $assignmentmatter;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="Score", mappedBy="control")
|
|
*/
|
|
private $scores;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->scores = new ArrayCollection();
|
|
}
|
|
|
|
public function getId(): ?int
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function getName(): ?string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function setName(string $name): self
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getDatestart(): ?\DateTimeInterface
|
|
{
|
|
return $this->datestart;
|
|
}
|
|
|
|
public function setDatestart(?\DateTimeInterface $datestart): self
|
|
{
|
|
$this->datestart = $datestart;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getPeriod(): ?Period
|
|
{
|
|
return $this->period;
|
|
}
|
|
|
|
public function setPeriod(?Period $period): self
|
|
{
|
|
$this->period = $period;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getAssignmentmatter(): ?Assignmentmatter
|
|
{
|
|
return $this->assignmentmatter;
|
|
}
|
|
|
|
public function setAssignmentmatter(?Assignmentmatter $assignmentmatter): self
|
|
{
|
|
$this->assignmentmatter = $assignmentmatter;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* @return Collection|Score[]
|
|
*/
|
|
public function getScores(): Collection
|
|
{
|
|
return $this->scores;
|
|
}
|
|
|
|
public function addScore(Score $score): self
|
|
{
|
|
if (!$this->scores->contains($score)) {
|
|
$this->scores[] = $score;
|
|
$score->setControl($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function removeScore(Score $score): self
|
|
{
|
|
if ($this->scores->contains($score)) {
|
|
$this->scores->removeElement($score);
|
|
// set the owning side to null (unless already changed)
|
|
if ($score->getControl() === $this) {
|
|
$score->setControl(null);
|
|
}
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
} |