<?php
namespace App\Entity;
use App\Repository\CaseSymptomRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CaseSymptomRepository::class), ORM\Table(name: 'case_symptoms')]
class CaseSymptom implements \Stringable
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Cases::class, inversedBy: 'symptoms')]
#[ORM\JoinColumn(name: 'case_id', nullable: false)]
private $case;
#[ORM\ManyToOne(targetEntity: Symptom::class), ORM\JoinColumn(nullable: false)]
private $symptom;
public function getId(): ?int
{
return $this->id;
}
public function getCase(): ?Cases
{
return $this->case;
}
public function setCase(?Cases $case): self
{
$this->case = $case;
return $this;
}
public function getSymptom(): ?Symptom
{
return $this->symptom;
}
public function setSymptom(?Symptom $symptom): self
{
$this->symptom = $symptom;
return $this;
}
public function __toString(): string
{
return (string) $this->symptom->getName();
}
}