src/Entity/Centers.php line 13
<?phpnamespace App\Entity;use App\Repository\CentersRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CentersRepository::class)]class Centers{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $Name = null;#[ORM\Column(length: 255, nullable: true)]private ?string $Address = null;#[ORM\Column(length: 255, nullable: true)]#[Assert\Regex(pattern: '/^(?:(?:\+|00)34[-.\s]?)?(?:(6\d{8}|[89]\d{8})|(?:[67]\d{8}|[89]\d{8}))$/', message: 'El número de teléfono no es válido')]private ?string $Phone = null;#[ORM\Column(length: 255, nullable: true)]private ?string $Mail = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $Created = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $Updated = null;#[ORM\OneToMany(mappedBy: 'center', targetEntity: Events::class)]private Collection $events;#[ORM\OneToMany(mappedBy: 'managementCenter', targetEntity: User::class)]private Collection $managementUsers;public function __construct(){$this->events = new ArrayCollection();$this->managementUsers = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->Name;}public function setName(string $Name): static{$this->Name = $Name;return $this;}public function getAddress(): ?string{return $this->Address;}public function setAddress(?string $Address): static{$this->Address = $Address;return $this;}public function getPhone(): ?string{return $this->Phone;}public function setPhone(?string $Phone): static{$this->Phone = $Phone;return $this;}public function getMail(): ?string{return $this->Mail;}public function setMail(?string $Mail): static{$this->Mail = $Mail;return $this;}public function getCreated(): ?\DateTimeInterface{return $this->Created;}public function setCreated(\DateTimeInterface $Created): static{$this->Created = $Created;return $this;}public function getUpdated(): ?\DateTimeInterface{return $this->Updated;}public function setUpdated(\DateTimeInterface $Updated): static{$this->Updated = $Updated;return $this;}public function getEvents(): Collection{return $this->events;}public function addEvent(Events $event): static{if (!$this->events->contains($event)) {$this->events->add($event);$event->setCenter($this);}return $this;}public function removeEvent(Events $event): static{if ($this->events->removeElement($event)) {// set the owning side to null (unless already changed)if ($event->getCenter() === $this) {$event->setCenter(null);}}return $this;}/*** @return Collection<int, User>*/public function getManagementUsers(): Collection{return $this->managementUsers;}}