WIP: Implement profile editing

This commit is contained in:
Björn Fromme committed 2023-09-17 19:36:18 +02:00
1 parent 97c5a686af
commit bfc5e5e242
17 files changed
+498 -18

No files matched your search

+6 -5
View File
@@ -25,13 +25,14 @@ class Address
#[ORM\Column(type: 'string', nullable: true)]
protected ?string $country = null;
public function toArray(): array
public function toPayload(): array
{
return [
'street' => $this->getStreet(),
'post_code' => $this->getPostCode(),
'city' => $this->getCity(),
'country' => $this->getCountry(),
'strasse' => $this->getStreet(),
'plz' => $this->getPostCode(),
'ort' => $this->getCity(),
'ortsteil' => '',
'land' => $this->getCountry(),
];
}
+9
View File
@@ -19,6 +19,15 @@ class Communication
#[Assert\Email(mode: 'strict')]
protected ?string $email = null;
public function toPayload(): array
{
return [
'email' => $this->getEmail(),
'telefonmobil' => $this->getMobile(),
'telefonprivat' => $this->getPhone(),
];
}
public static function fromApiResponse(ProfileResponse $profileResponse): static
{
$communication = $profileResponse->getCommunication();