src/Entity/Contract.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6.  * @ORM\Entity(repositoryClass="App\Repository\ContractRepository")
  7.  */
  8. class Contract
  9. {
  10.     /**
  11.      * @ORM\Id()
  12.      * @ORM\GeneratedValue()
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="datetime")
  18.      */
  19.     private $dateStart;
  20.     /**
  21.      * @ORM\Column(type="datetime")
  22.      */
  23.     private $dateEnd;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="App\Entity\Company",inversedBy="contracts")
  26.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  27.      * @Assert\NotNull()
  28.      */
  29.     private $company;
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getDateStart(): ?\DateTime
  35.     {
  36.         return $this->dateStart;
  37.     }
  38.     public function setDateStart(\DateTime $dateStart): self
  39.     {
  40.         $this->dateStart $dateStart;
  41.         return $this;
  42.     }
  43.     public function getDateEnd(): ?\DateTime
  44.     {
  45.         return $this->dateEnd;
  46.     }
  47.     public function setDateEnd(\DateTime $dateEnd): self
  48.     {
  49.         $this->dateEnd $dateEnd;
  50.         return $this;
  51.     }
  52.     public function getCompany(): ?Company
  53.     {
  54.         return $this->company;
  55.     }
  56.     public function setCompany(?Company $company): self
  57.     {
  58.         $this->company $company;
  59.         return $this;
  60.     }
  61. }