- <?php
- namespace App\Entity;
- use App\Repository\HospitalRepository;
- use Doctrine\ORM\Mapping as ORM;
- use Gedmo\Mapping\Annotation as Gedmo;
- use Symfony\Component\Validator\Constraints as Assert;
- #[ORM\Entity(repositoryClass: HospitalRepository::class), ORM\Table(name: 'hospitals')]
- class Hospital implements \Stringable
- {
-     #[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]
-     private $id;
-     #[ORM\Column(type: 'string', length: 15)]
-     private string $hNum = 'hNum-000';
-     #[ORM\Column(type: 'string', length: 50, nullable: true), Assert\NotBlank]
-     #[Assert\Length(
-         max: 30,
-         minMessage: 'Registration No. must be at least {{ limit }} number long',
-         maxMessage: 'Registration No. cannot be longer than {{ limit }} number'
-     )]
-     private $regNum;
-     #[ORM\Column(type: 'string', length: 50, nullable: true)]
-     private $abhaNum;
-     #[ORM\Column(type: 'date', nullable: true)]
-     private $regDate;
-     #[ORM\Column(type: 'date', nullable: true)]
-     private $abhaDate;
-     #[ORM\Column(type: 'string', nullable: true)]
-     private $hip_id;
-     #[ORM\Column(type: 'string', nullable: true)]
-     private $hip_name;
-     #[ORM\Column(type: 'string', nullable: true)]
-     private $hiu_id;
-     #[ORM\Column(type: 'string', nullable: true)]
-     private $hiu_name;
-     #[ORM\Column(type: 'string', length: 50), Assert\NotBlank]
-     #[Assert\Length(max: 50, maxMessage: 'Name cannot be longer than {{ limit }} characters')]
-     private $name;
-     #[ORM\Column(type: 'string', length: 25), Assert\NotBlank]
-     private $type;
-     #[ORM\Column(type: 'integer')]
-     private $level = 1;
-     #[ORM\Column(type: 'string', length: 15, nullable: true)]
-     #[Assert\Length(
-         max: 12,
-         minMessage: 'code must be at least {{ limit }} number long',
-         maxMessage: 'code cannot be longer than {{ limit }} number'
-     )]
-     #[Assert\Regex(pattern: '/^[0-9]*$/', message: 'code must be in digits only')]
-     private $code;
-     #[ORM\Column(type: 'boolean')]
-     private bool $isActive = true;
-     #[ORM\ManyToOne(targetEntity: District::class), ORM\JoinColumn(nullable: false), Assert\NotBlank]
-     private $district;
-     #[ORM\ManyToOne(targetEntity: Taluka::class), ORM\JoinColumn(nullable: false), Assert\NotBlank]
-     private $taluka;
-     #[ORM\ManyToOne(targetEntity: Village::class), ORM\JoinColumn(nullable: false), Assert\NotBlank]
-     private $village;
-     #[ORM\Column(type: 'text', nullable: true)]
-     private $address;
-     #[ORM\Column(type: 'string', length: 10, nullable: true)]
-     #[Assert\Length(
-         min: 6,
-         max: 6,
-         minMessage: 'Pin code must be at least {{ limit }} characters long',
-         maxMessage: 'Pin code cannot be longer than {{ limit }} characters'
-     )]
-     #[Assert\Regex(pattern: '/^[0-9]*$/', message: 'Pin code must be in digits only')]
-     private $pincode;
-     #[ORM\Column(type: 'string', length: 15), Assert\NotBlank]
-     #[Assert\Length(
-         min: 8,
-         max: 12,
-         minMessage: 'Contact No. must be at least {{ limit }} characters long',
-         maxMessage: 'Contact No. cannot be longer than {{ limit }} characters'
-     )]
-     #[Assert\Regex(pattern: '/^[0-9]*$/', message: 'Contact No. must be in digits only')]
-     private $phone;
-     #[ORM\Column(type: 'string', length: 100,  nullable: true), Assert\Email]
-     private $email;
-     #[ORM\Column(type: 'decimal', precision: 12, scale: 8, nullable: true)]
-     private $latitude;
-     #[ORM\Column(type: 'decimal', precision: 12, scale: 8, nullable: true)]
-     private $longitude;
-     #[Gedmo\Timestampable(on: 'create'), ORM\Column(type: 'datetime')]
-     private $createdAt;
-     #[Gedmo\Timestampable(on: 'update'), ORM\Column(type: 'datetime')]
-     private $updatedAt;
-     public function getId(): ?int
-     {
-         return $this->id;
-     }
-     public function getHNum(): ?string
-     {
-         return $this->hNum;
-     }
-     public function setHNum(string $hNum): self
-     {
-         $this->hNum = strip_tags($hNum);
-         return $this;
-     }
-     public function getRegNum(): ?string
-     {
-         return $this->regNum;
-     }
-     public function setRegNum(string $regNum): self
-     {
-         $this->regNum = strip_tags($regNum);
-         return $this;
-     }
-     public function getAbhaNum(): ?string
-     {
-         return $this->abhaNum;
-     }
-     public function setAbhaNum(string $abhaNum): self
-     {
-         $this->abhaNum = strip_tags($abhaNum);
-         return $this;
-     }
-     public function getRegDate(): ?\DateTimeInterface
-     {
-         return $this->regDate;
-     }
-     public function setRegDate(?\DateTimeInterface $regDate): self
-     {
-         $this->regDate = $regDate;
-         return $this;
-     }
-     public function getAbhaDate(): ?\DateTimeInterface
-     {
-         return $this->abhaDate;
-     }
-     public function setAbhaDate(?\DateTimeInterface $abhaDate): self
-     {
-         $this->abhaDate = $abhaDate;
-         return $this;
-     }
-     public function getName(): ?string
-     {
-         return $this->name;
-     }
-     public function setName(string $name): self
-     {
-         $this->name = strip_tags($name);
-         return $this;
-     }
-     public function getType(): ?string
-     {
-         return $this->type;
-     }
-     public function setType(string $type): self
-     {
-         $this->type = strip_tags($type);
-         return $this;
-     }
-     public function getLevel(): ?int
-     {
-         return $this->level;
-     }
-     public function setLevel(int $level): self
-     {
-         $this->level = strip_tags($level);
-         return $this;
-     }
-     public function getCode(): ?string
-     {
-         return $this->code;
-     }
-     public function setCode(string $code): self
-     {
-         $this->code = $code;
-         return $this;
-     }
-     public function getIsActive(): ?bool
-     {
-         return $this->isActive;
-     }
-     public function setIsActive(bool $isActive): self
-     {
-         $this->isActive = $isActive;
-         return $this;
-     }
-     public function getDistrict(): ?District
-     {
-         return $this->district;
-     }
-     public function setDistrict(?District $district): self
-     {
-         $this->district = $district;
-         return $this;
-     }
-     public function getTaluka(): ?Taluka
-     {
-         return $this->taluka;
-     }
-     public function setTaluka(?Taluka $taluka): self
-     {
-         $this->taluka = $taluka;
-         return $this;
-     }
-     public function getVillage(): ?Village
-     {
-         return $this->village;
-     }
-     public function setVillage(Village $village): self
-     {
-         $this->village = $village;
-         return $this;
-     }
-     public function getAddress(): ?string
-     {
-         return $this->address;
-     }
-     public function setAddress(?string $address): self
-     {
-         $this->address = strip_tags($address);
-         return $this;
-     }
-     public function getPincode(): ?string
-     {
-         return $this->pincode;
-     }
-     public function setPincode(?string $pincode): self
-     {
-         $this->pincode = $pincode;
-         return $this;
-     }
-     public function getPhone(): ?string
-     {
-         return $this->phone;
-     }
-     public function setPhone(string $phone): self
-     {
-         $this->phone = $phone;
-         return $this;
-     }
-     public function getEmail(): ?string
-     {
-         return $this->email;
-     }
-     public function setEmail(?string $email): self
-     {
-         $this->email = strip_tags($email);
-         return $this;
-     }
-     public function getCreatedAt(): ?\DateTimeInterface
-     {
-         return $this->createdAt;
-     }
-     public function getUpdatedAt(): ?\DateTimeInterface
-     {
-         return $this->updatedAt;
-     }
-     public function __toString(): string
-     {
-         return $this->getName();
-     }
-     public function getLatitude(): ?string
-     {
-         return $this->latitude;
-     }
-     public function setLatitude(string $latitude): self
-     {
-         $this->latitude = $latitude;
-         return $this;
-     }
-     public function getLongitude(): ?string
-     {
-         return $this->longitude;
-     }
-     public function setLongitude(string $longitude): self
-     {
-         $this->longitude = $longitude;
-         return $this;
-     }
-     public function getHIPCode(): ?string
-     {
-         return $this->hip_id;
-     }
-     public function setHIPCode(string $hip_id): self
-     {
-         $this->hip_id = strip_tags($hip_id);
-         return $this;
-     }
-     public function getHIUCode(): ?string
-     {
-         return $this->hiu_id;
-     }
-     public function setHIUCode(string $hiu_id): self
-     {
-         $this->hiu_id = strip_tags($hiu_id);
-         return $this;
-     }
-     public function setHIUName(string $hiu_name): self
-     {
-         $this->hiu_name = $hiu_name;
-         return $this;
-     }
-     public function getHIUName(): ?string
-     {
-         return $this->hiu_name;
-     }
-     public function getHIPName(): ?string
-     {
-         return $this->hip_name;
-     }
-     public function setHIPName(string $hip_name): self
-     {
-         $this->hip_name = $hip_name;
-         return $this;
-     }
- }
-