<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\ContractRepository")
*/
class Contract
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="datetime")
*/
private $dateStart;
/**
* @ORM\Column(type="datetime")
*/
private $dateEnd;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Company",inversedBy="contracts")
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
* @Assert\NotNull()
*/
private $company;
public function getId(): ?int
{
return $this->id;
}
public function getDateStart(): ?\DateTime
{
return $this->dateStart;
}
public function setDateStart(\DateTime $dateStart): self
{
$this->dateStart = $dateStart;
return $this;
}
public function getDateEnd(): ?\DateTime
{
return $this->dateEnd;
}
public function setDateEnd(\DateTime $dateEnd): self
{
$this->dateEnd = $dateEnd;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
}