src/Entity/Hospital.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\HospitalRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity(repositoryClassHospitalRepository::class), ORM\Table(name'hospitals')]
  8. class Hospital implements \Stringable
  9. {
  10.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length15)]
  13.     private string $hNum 'hNum-000';
  14.     #[ORM\Column(type'string'length50nullabletrue), Assert\NotBlank]
  15.     #[Assert\Length(
  16.         max30,
  17.         minMessage'Registration No. must be at least {{ limit }} number long',
  18.         maxMessage'Registration No. cannot be longer than {{ limit }} number'
  19.     )]
  20.     private $regNum;
  21.     #[ORM\Column(type'string'length50nullabletrue)]
  22.     private $abhaNum;
  23.     #[ORM\Column(type'date'nullabletrue)]
  24.     private $regDate;
  25.     #[ORM\Column(type'date'nullabletrue)]
  26.     private $abhaDate;
  27.     #[ORM\Column(type'string'nullabletrue)]
  28.     private $hip_id;
  29.     #[ORM\Column(type'string'nullabletrue)]
  30.     private $hip_name;
  31.     #[ORM\Column(type'string'nullabletrue)]
  32.     private $hiu_id;
  33.     #[ORM\Column(type'string'nullabletrue)]
  34.     private $hiu_name;
  35.     #[ORM\Column(type'string'length50), Assert\NotBlank]
  36.     #[Assert\Length(max50maxMessage'Name cannot be longer than {{ limit }} characters')]
  37.     private $name;
  38.     #[ORM\Column(type'string'length25), Assert\NotBlank]
  39.     private $type;
  40.     #[ORM\Column(type'integer')]
  41.     private $level 1;
  42.     #[ORM\Column(type'string'length15nullabletrue)]
  43.     #[Assert\Length(
  44.         max12,
  45.         minMessage'code must be at least {{ limit }} number long',
  46.         maxMessage'code cannot be longer than {{ limit }} number'
  47.     )]
  48.     #[Assert\Regex(pattern'/^[0-9]*$/'message'code must be in digits only')]
  49.     private $code;
  50.     #[ORM\Column(type'boolean')]
  51.     private bool $isActive true;
  52.     #[ORM\ManyToOne(targetEntityDistrict::class), ORM\JoinColumn(nullablefalse), Assert\NotBlank]
  53.     private $district;
  54.     #[ORM\ManyToOne(targetEntityTaluka::class), ORM\JoinColumn(nullablefalse), Assert\NotBlank]
  55.     private $taluka;
  56.     #[ORM\ManyToOne(targetEntityVillage::class), ORM\JoinColumn(nullablefalse), Assert\NotBlank]
  57.     private $village;
  58.     #[ORM\Column(type'text'nullabletrue)]
  59.     private $address;
  60.     #[ORM\Column(type'string'length10nullabletrue)]
  61.     #[Assert\Length(
  62.         min6,
  63.         max6,
  64.         minMessage'Pin code must be at least {{ limit }} characters long',
  65.         maxMessage'Pin code cannot be longer than {{ limit }} characters'
  66.     )]
  67.     #[Assert\Regex(pattern'/^[0-9]*$/'message'Pin code must be in digits only')]
  68.     private $pincode;
  69.     #[ORM\Column(type'string'length15), Assert\NotBlank]
  70.     #[Assert\Length(
  71.         min8,
  72.         max12,
  73.         minMessage'Contact No. must be at least {{ limit }} characters long',
  74.         maxMessage'Contact No. cannot be longer than {{ limit }} characters'
  75.     )]
  76.     #[Assert\Regex(pattern'/^[0-9]*$/'message'Contact No. must be in digits only')]
  77.     private $phone;
  78.     #[ORM\Column(type'string'length100,  nullabletrue), Assert\Email]
  79.     private $email;
  80.     #[ORM\Column(type'decimal'precision12scale8nullabletrue)]
  81.     private $latitude;
  82.     #[ORM\Column(type'decimal'precision12scale8nullabletrue)]
  83.     private $longitude;
  84.     #[Gedmo\Timestampable(on'create'), ORM\Column(type'datetime')]
  85.     private $createdAt;
  86.     #[Gedmo\Timestampable(on'update'), ORM\Column(type'datetime')]
  87.     private $updatedAt;
  88.     public function getId(): ?int
  89.     {
  90.         return $this->id;
  91.     }
  92.     public function getHNum(): ?string
  93.     {
  94.         return $this->hNum;
  95.     }
  96.     public function setHNum(string $hNum): self
  97.     {
  98.         $this->hNum strip_tags($hNum);
  99.         return $this;
  100.     }
  101.     public function getRegNum(): ?string
  102.     {
  103.         return $this->regNum;
  104.     }
  105.     public function setRegNum(string $regNum): self
  106.     {
  107.         $this->regNum strip_tags($regNum);
  108.         return $this;
  109.     }
  110.     public function getAbhaNum(): ?string
  111.     {
  112.         return $this->abhaNum;
  113.     }
  114.     public function setAbhaNum(string $abhaNum): self
  115.     {
  116.         $this->abhaNum strip_tags($abhaNum);
  117.         return $this;
  118.     }
  119.     public function getRegDate(): ?\DateTimeInterface
  120.     {
  121.         return $this->regDate;
  122.     }
  123.     public function setRegDate(?\DateTimeInterface $regDate): self
  124.     {
  125.         $this->regDate $regDate;
  126.         return $this;
  127.     }
  128.     public function getAbhaDate(): ?\DateTimeInterface
  129.     {
  130.         return $this->abhaDate;
  131.     }
  132.     public function setAbhaDate(?\DateTimeInterface $abhaDate): self
  133.     {
  134.         $this->abhaDate $abhaDate;
  135.         return $this;
  136.     }
  137.     public function getName(): ?string
  138.     {
  139.         return $this->name;
  140.     }
  141.     public function setName(string $name): self
  142.     {
  143.         $this->name strip_tags($name);
  144.         return $this;
  145.     }
  146.     public function getType(): ?string
  147.     {
  148.         return $this->type;
  149.     }
  150.     public function setType(string $type): self
  151.     {
  152.         $this->type strip_tags($type);
  153.         return $this;
  154.     }
  155.     public function getLevel(): ?int
  156.     {
  157.         return $this->level;
  158.     }
  159.     public function setLevel(int $level): self
  160.     {
  161.         $this->level strip_tags($level);
  162.         return $this;
  163.     }
  164.     public function getCode(): ?string
  165.     {
  166.         return $this->code;
  167.     }
  168.     public function setCode(string $code): self
  169.     {
  170.         $this->code $code;
  171.         return $this;
  172.     }
  173.     public function getIsActive(): ?bool
  174.     {
  175.         return $this->isActive;
  176.     }
  177.     public function setIsActive(bool $isActive): self
  178.     {
  179.         $this->isActive $isActive;
  180.         return $this;
  181.     }
  182.     public function getDistrict(): ?District
  183.     {
  184.         return $this->district;
  185.     }
  186.     public function setDistrict(?District $district): self
  187.     {
  188.         $this->district $district;
  189.         return $this;
  190.     }
  191.     public function getTaluka(): ?Taluka
  192.     {
  193.         return $this->taluka;
  194.     }
  195.     public function setTaluka(?Taluka $taluka): self
  196.     {
  197.         $this->taluka $taluka;
  198.         return $this;
  199.     }
  200.     public function getVillage(): ?Village
  201.     {
  202.         return $this->village;
  203.     }
  204.     public function setVillage(Village $village): self
  205.     {
  206.         $this->village $village;
  207.         return $this;
  208.     }
  209.     public function getAddress(): ?string
  210.     {
  211.         return $this->address;
  212.     }
  213.     public function setAddress(?string $address): self
  214.     {
  215.         $this->address strip_tags($address);
  216.         return $this;
  217.     }
  218.     public function getPincode(): ?string
  219.     {
  220.         return $this->pincode;
  221.     }
  222.     public function setPincode(?string $pincode): self
  223.     {
  224.         $this->pincode $pincode;
  225.         return $this;
  226.     }
  227.     public function getPhone(): ?string
  228.     {
  229.         return $this->phone;
  230.     }
  231.     public function setPhone(string $phone): self
  232.     {
  233.         $this->phone $phone;
  234.         return $this;
  235.     }
  236.     public function getEmail(): ?string
  237.     {
  238.         return $this->email;
  239.     }
  240.     public function setEmail(?string $email): self
  241.     {
  242.         $this->email strip_tags($email);
  243.         return $this;
  244.     }
  245.     public function getCreatedAt(): ?\DateTimeInterface
  246.     {
  247.         return $this->createdAt;
  248.     }
  249.     public function getUpdatedAt(): ?\DateTimeInterface
  250.     {
  251.         return $this->updatedAt;
  252.     }
  253.     public function __toString(): string
  254.     {
  255.         return $this->getName();
  256.     }
  257.     public function getLatitude(): ?string
  258.     {
  259.         return $this->latitude;
  260.     }
  261.     public function setLatitude(string $latitude): self
  262.     {
  263.         $this->latitude $latitude;
  264.         return $this;
  265.     }
  266.     public function getLongitude(): ?string
  267.     {
  268.         return $this->longitude;
  269.     }
  270.     public function setLongitude(string $longitude): self
  271.     {
  272.         $this->longitude $longitude;
  273.         return $this;
  274.     }
  275.     public function getHIPCode(): ?string
  276.     {
  277.         return $this->hip_id;
  278.     }
  279.     public function setHIPCode(string $hip_id): self
  280.     {
  281.         $this->hip_id strip_tags($hip_id);
  282.         return $this;
  283.     }
  284.     public function getHIUCode(): ?string
  285.     {
  286.         return $this->hiu_id;
  287.     }
  288.     public function setHIUCode(string $hiu_id): self
  289.     {
  290.         $this->hiu_id strip_tags($hiu_id);
  291.         return $this;
  292.     }
  293.     public function setHIUName(string $hiu_name): self
  294.     {
  295.         $this->hiu_name $hiu_name;
  296.         return $this;
  297.     }
  298.     public function getHIUName(): ?string
  299.     {
  300.         return $this->hiu_name;
  301.     }
  302.     public function getHIPName(): ?string
  303.     {
  304.         return $this->hip_name;
  305.     }
  306.     public function setHIPName(string $hip_name): self
  307.     {
  308.         $this->hip_name $hip_name;
  309.         return $this;
  310.     }
  311. }