mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
normalization of phonenumber
This commit is contained in:
@@ -372,6 +372,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
/**
|
||||
* The person's mobile phone number.
|
||||
*
|
||||
* @PhonenumberConstraint(type="mobile")
|
||||
* @ORM\Column(type="phone_number")
|
||||
*/
|
||||
private ?PhoneNumber $mobilenumber;
|
||||
@@ -425,6 +426,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* The person's phonenumber.
|
||||
*
|
||||
* @ORM\Column(type="phone_number")
|
||||
* @PhonenumberConstraint(
|
||||
* type="landline",
|
||||
* )
|
||||
*/
|
||||
private ?PhoneNumber $phonenumber;
|
||||
|
||||
|
@@ -21,6 +21,7 @@ use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use DateTime;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use libphonenumber\PhoneNumber;
|
||||
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerAwareTrait;
|
||||
@@ -111,12 +112,12 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
break;
|
||||
|
||||
case 'phonenumber':
|
||||
$person->setPhonenumber($this->phoneNumberHelper->denormalize($data[$item]));
|
||||
$person->setPhonenumber($this->denormalizer->denormalize($data[$item], PhoneNumber::class, $format, $context));
|
||||
|
||||
break;
|
||||
|
||||
case 'mobilenumber':
|
||||
$person->setMobilenumber($this->phoneNumberHelper->denormalize($data[$item]));
|
||||
$person->setMobilenumber($this->denormalizer->denormalize($data[$item], PhoneNumber::class, $format, $context));
|
||||
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user