diff --git a/migrations/Version20250710090534.php b/migrations/Version20250710090534.php new file mode 100644 index 0000000..166b4d5 --- /dev/null +++ b/migrations/Version20250710090534.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE "user" ADD phone_number VARCHAR(20) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE "user" DROP phone_number'); + } +} diff --git a/src/Entity/User.php b/src/Entity/User.php index 5b742ba..6215cab 100644 --- a/src/Entity/User.php +++ b/src/Entity/User.php @@ -45,7 +45,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface private ?\DateTimeImmutable $createdAt = null; #[ORM\Column(length: 255)] - private ?string $picture_url = null; + private ?string $pictureUrl = null; #[ORM\Column(options: ['default' => 'CURRENT_TIMESTAMP'])] private ?\DateTimeImmutable $modifiedAt = null; @@ -59,10 +59,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTime $lastConnection = null; + #[ORM\Column(length: 20, nullable: true)] + private ?string $phoneNumber = null; - public function __construct() - { - } public function getId(): ?int { @@ -177,12 +176,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface public function getPictureUrl(): ?string { - return $this->picture_url; + return $this->pictureUrl; } - public function setPictureUrl(string $picture_url): static + public function setPictureUrl(string $pictureUrl): static { - $this->picture_url = $picture_url; + $this->pictureUrl = $pictureUrl; return $this; } @@ -243,5 +242,17 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface return $this; } + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + public function setPhoneNumber(?string $phoneNumber): static + { + $this->phoneNumber = $phoneNumber; + + return $this; + } + }