mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
upgrade phonenumber on 3party: migrations
This commit is contained in:
@@ -24,6 +24,7 @@ use DateTimeInterface;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use libphonenumber\PhoneNumber;
|
||||
use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
@@ -253,14 +254,14 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?ThirdPartyProfession $profession = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="telephone", type="string", length=64, nullable=true)
|
||||
* @ORM\Column(name="telephone", type="phone_number", nullable=true)
|
||||
* @Assert\Regex("/^([\+{1}])([0-9\s*]{4,20})$/",
|
||||
* message="Invalid phone number: it should begin with the international prefix starting with ""+"", hold only digits and be smaller than 20 characters. Ex: +33123456789"
|
||||
* )
|
||||
* @PhonenumberConstraint(type="any")
|
||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||
*/
|
||||
private ?string $telephone = null;
|
||||
private ?PhoneNumber $telephone = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="types", type="json", nullable=true)
|
||||
@@ -502,7 +503,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
/**
|
||||
* Get telephone.
|
||||
*/
|
||||
public function getTelephone(): ?string
|
||||
public function getTelephone(): ?PhoneNumber
|
||||
{
|
||||
return $this->telephone;
|
||||
}
|
||||
@@ -821,12 +822,8 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* Set telephone.
|
||||
*
|
||||
* @param string|null $telephone
|
||||
*
|
||||
* @return ThirdParty
|
||||
*/
|
||||
public function setTelephone($telephone = null)
|
||||
public function setTelephone(?PhoneNumber $telephone = null): self
|
||||
{
|
||||
$this->telephone = $telephone;
|
||||
|
||||
|
Reference in New Issue
Block a user