src/Entity/CaseSymptom.php line 9

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