src/Entity/Phone.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. class Phone
  5. {
  6.     /**
  7.      * @Assert\Type("string")
  8.      *
  9.      *
  10.      * @Assert\Length(
  11.      *      min = 0,
  12.      *      max = 250,
  13.      *      maxMessage = "Jméno nesmí mít více než 250 znaků.",
  14.      * )
  15.      */
  16.     private $name;
  17.     /**
  18.      * @Assert\Type("string")
  19.      *
  20.      * @Assert\NotBlank(
  21.      * message="Vyplňte telefon"
  22.      * )
  23.      *
  24.      * @Assert\Regex(
  25.      *    pattern="/^\+?[\d\s\.\-\*\#\(\)\\\/]{6,20}$/",
  26.      *    message="Vložte validní telefonní číslo.",
  27.      * )
  28.      */
  29.     private $phone;
  30.     /**
  31.      * @Assert\Type("string")
  32.      *
  33.      * @Assert\NotBlank(
  34.      * message="Pole nesmí být prázdné."
  35.      * )
  36.      *
  37.      * @Assert\Regex(
  38.      * pattern="/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/iD",
  39.      * message="Vložte validní e-mail.",
  40.      * )
  41.      */
  42.     private $email;
  43.     /**
  44.      * @Assert\Type("string")
  45.      *
  46.      * @Assert\Length(
  47.      *      min = 0,
  48.      *      max = 450,
  49.      *      maxMessage = "Zpráva nesmí mít více než 450 znaků.",
  50.      * )
  51.      */
  52.     private $detail;
  53.     /**
  54.      * @Assert\Type("string")
  55.      *
  56.      * @Assert\Length(
  57.      *      min = 0,
  58.      *      max = 58,
  59.      *      maxMessage = "Město nesmí mít více než 58 znaků.",
  60.      * )
  61.      */
  62.     private $city;
  63.     public function getName(): ?string
  64.     {
  65.         return $this->name;
  66.     }
  67.     public function setName(string $name): self
  68.     {
  69.         $this->name $name;
  70.         return $this;
  71.     }
  72.     public function getPhone(): ?string
  73.     {
  74.         return $this->phone;
  75.     }
  76.     public function setPhone(string $phone): self
  77.     {
  78.         $this->phone $phone;
  79.         return $this;
  80.     }
  81.     public function getEmail(): ?string
  82.     {
  83.         return $this->email;
  84.     }
  85.     public function setEmail(string $email): self
  86.     {
  87.         $this->email $email;
  88.         return $this;
  89.     }
  90.     public function getDetail(): ?string
  91.     {
  92.         return $this->detail;
  93.     }
  94.     public function setDetail(string $detail): self
  95.     {
  96.         $this->detail $detail;
  97.         return $this;
  98.     }
  99.     public function getCity(): ?string
  100.     {
  101.         return $this->city;
  102.     }
  103.     public function setCity(string $city): self
  104.     {
  105.         $this->city $city;
  106.         return $this;
  107.     }
  108. }