src/Entity/BusinessSubscription.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BusinessSubscriptionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Timestampable\Traits\TimestampableEntity;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. #[ORM\Entity(repositoryClassBusinessSubscriptionRepository::class)]
  8. class BusinessSubscription
  9. {
  10.     use TimestampableEntity;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length100)]
  16.     #[Assert\Regex(pattern"/^[a-zA-Z0-9_\s-]{2,}$/")]
  17.     #[Assert\NotNull]
  18.     private ?string $name null;
  19.     #[ORM\Column(length150)]
  20.     #[Assert\Email]
  21.     #[Assert\NotNull]
  22.     private ?string $email null;
  23.     #[ORM\Column(length100)]
  24.     #[Assert\Regex(pattern"/^\+?\d{1,3}?[-. ]?\d{7,10}$/")]
  25.     #[Assert\NotNull]
  26.     private ?string $phone null;
  27.     #[ORM\Column(length255)]
  28.     private ?string $address null;
  29.     #[ORM\ManyToOne]
  30.     #[ORM\JoinColumn(nullablefalse)]
  31.     #[Assert\NotNull]
  32.     private ?City $city null;
  33.     #[ORM\ManyToOne]
  34.     private ?User $user null;
  35.     #[ORM\Column(nullabletrue)]
  36.     private ?bool $approved null;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): static
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getEmail(): ?string
  51.     {
  52.         return $this->email;
  53.     }
  54.     public function setEmail(string $email): static
  55.     {
  56.         $this->email $email;
  57.         return $this;
  58.     }
  59.     public function getPhone(): ?string
  60.     {
  61.         return $this->phone;
  62.     }
  63.     public function setPhone(?string $phone): static
  64.     {
  65.         $this->phone $phone;
  66.         return $this;
  67.     }
  68.     public function getAddress(): ?string
  69.     {
  70.         return $this->address;
  71.     }
  72.     public function setAddress(string $address): static
  73.     {
  74.         $this->address $address;
  75.         return $this;
  76.     }
  77.     public function getCity(): ?City
  78.     {
  79.         return $this->city;
  80.     }
  81.     public function setCity(?City $city): static
  82.     {
  83.         $this->city $city;
  84.         return $this;
  85.     }
  86.     public function getUser(): ?User
  87.     {
  88.         return $this->user;
  89.     }
  90.     public function setUser(?User $user): static
  91.     {
  92.         $this->user $user;
  93.         return $this;
  94.     }
  95.     public function isApproved(): ?bool
  96.     {
  97.         return $this->approved;
  98.     }
  99.     public function setApproved(?bool $approved): static
  100.     {
  101.         $this->approved $approved;
  102.         return $this;
  103.     }
  104. }