src/Entity/CaseNcd.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CaseNcdRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCaseNcdRepository::class), ORM\Table(name'case_ncds')]
  6. class CaseNcd implements \Stringable
  7. {
  8.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  9.     private $id;
  10.     #[ORM\ManyToOne(targetEntityCases::class, inversedBy'ncds'), ORM\JoinColumn(name'case_id'nullablefalse)]
  11.     private $case;
  12.     #[ORM\ManyToOne(targetEntityNcd::class), ORM\JoinColumn(nullablefalse)]
  13.     private $ncd;
  14.     public function getId(): ?int
  15.     {
  16.         return $this->id;
  17.     }
  18.     public function getCase(): ?Cases
  19.     {
  20.         return $this->case;
  21.     }
  22.     public function setCase(?Cases $case): self
  23.     {
  24.         $this->case $case;
  25.         return $this;
  26.     }
  27.     public function getNcd(): ?Ncd
  28.     {
  29.         return $this->ncd;
  30.     }
  31.     public function setNcd(?Ncd $ncd): self
  32.     {
  33.         $this->ncd $ncd;
  34.         return $this;
  35.     }
  36.     public function __toString(): string
  37.     {
  38.         return (string) $this->ncd->getName();
  39.     }
  40. }