Browse Source

fix birthday

master
Daniel 2 years ago
parent
commit
a7465ab42d
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/Mapper/ContactApiToEntityMapper.php

+ 4
- 1
src/Mapper/ContactApiToEntityMapper.php View File

@@ -57,7 +57,10 @@ class ContactApiToEntityMapper implements MapperInterface

$entity->setFirstName($dto->firstName);
$entity->setLastName($dto->lastName);
$entity->setBirthday($dto->birthday);
$birthDay = $dto->birthday !== null ?
\DateTimeImmutable::createFromFormat('Y-m-d', $dto->birthday) :
null;
$entity->setBirthday($birthDay);
$entity->setImage($dto->image);
$entity->setPosition($dto->position);
$entity->setPhone($dto->phone);


Loading…
Cancel
Save