diff --git a/.idea/symfony2.xml b/.idea/symfony2.xml new file mode 100644 index 0000000..bd98e40 --- /dev/null +++ b/.idea/symfony2.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/migrations/Version20261026160000.php b/migrations/Version20261026160000.php new file mode 100644 index 0000000..17f97f2 --- /dev/null +++ b/migrations/Version20261026160000.php @@ -0,0 +1,28 @@ +addSql('ALTER TABLE contacts ADD pid VARCHAR(255) DEFAULT NULL'); + $this->addSql('ALTER TABLE contacts ADD fallnr VARCHAR(255) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE contacts DROP pid'); + $this->addSql('ALTER TABLE contacts DROP fallnr'); + } +} diff --git a/src/Command/CleanMobileCommand.php b/src/Command/CleanMobileCommand.php index 8262777..dac0900 100644 --- a/src/Command/CleanMobileCommand.php +++ b/src/Command/CleanMobileCommand.php @@ -222,6 +222,10 @@ final class CleanMobileCommand extends Command // Create a Contact entity for DB insertion $contact = new Contacts(); $contact->setPhoneNumber($row['HANDY_E164']); + $pid = trim($row['PID'] ?? ''); + $fallnr = trim($row['FALLNR'] ?? ''); + $contact->setPid($pid === '' ? null : $pid); + $contact->setFallnr($fallnr === '' ? null : $fallnr); $today = new \DateTime('today'); $dueDate = ($today)->setTime(12, 0, 0); $contact->setDueDate($dueDate); diff --git a/src/Entity/Contacts.php b/src/Entity/Contacts.php index d8e0a0b..dfa903d 100644 --- a/src/Entity/Contacts.php +++ b/src/Entity/Contacts.php @@ -21,6 +21,12 @@ class Contacts #[ORM\Column(length: 255, nullable: true)] private ?string $phone_number = null; + #[ORM\Column(length: 255, nullable: true)] + private ?string $pid = null; + + #[ORM\Column(length: 255, nullable: true)] + private ?string $fallnr = null; + #[ORM\Column(nullable: true)] private ?\DateTime $due_date = null; @@ -100,6 +106,30 @@ class Contacts return $this; } + public function getPid(): ?string + { + return $this->pid; + } + + public function setPid(?string $pid): static + { + $this->pid = $pid; + + return $this; + } + + public function getFallnr(): ?string + { + return $this->fallnr; + } + + public function setFallnr(?string $fallnr): static + { + $this->fallnr = $fallnr; + + return $this; + } + public function getDueDate(): ?\DateTime { return $this->due_date;