feat(validation): enforce naming rules for doctors and clinics to prevent placeholders
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Auth\Entity\User;
|
||||
use App\Doctor\Entity\Doctor;
|
||||
use App\DoctorService\Entity\DoctorService;
|
||||
use App\Insurance\Entity\Insurance;
|
||||
use App\Shared\Util\DisplayName;
|
||||
use App\Specialty\Entity\Specialty;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -166,7 +167,8 @@ class Clinic
|
||||
public function getServices(): Collection { return $this->services; }
|
||||
public function getInsurances(): Collection { return $this->insurances; }
|
||||
|
||||
public function setName(?string $v): self { $this->name = $v; $this->touch(); return $this; }
|
||||
// null مجاز است (کلینیک تازهساخته هنوز نام ندارد)؛ ولی نام آلوده رد میشود.
|
||||
public function setName(?string $v): self { if ($v !== null) DisplayName::assertReal($v); $this->name = $v; $this->touch(); return $this; }
|
||||
public function setInfo(?string $v): self { $this->info = $v; $this->touch(); return $this; }
|
||||
public function setAddress(?string $v): self { $this->address = $v; $this->touch(); return $this; }
|
||||
public function setTelephone(?string $v): self { $this->telephone = $v; $this->touch(); return $this; }
|
||||
|
||||
Reference in New Issue
Block a user