mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge remote-tracking branch 'origin/master' into url_in_accompanyingPeriodWork_evaluations
This commit is contained in:
@@ -18,8 +18,8 @@ use Chill\PersonBundle\Repository\ResidentialAddressRepository;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Serializer\Annotation\Context;
|
||||
use Symfony\Component\Serializer\Annotation\Groups;
|
||||
|
||||
/**
|
||||
* @ORM\Entity(repositoryClass=ResidentialAddressRepository::class)
|
||||
@@ -49,7 +49,7 @@ class ResidentialAddress
|
||||
* @ORM\ManyToOne(targetEntity=Person::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
* @Groups({"read"})
|
||||
* @Context(normalizationContext={"groups"={"minimal"}})
|
||||
* @Context(normalizationContext={"groups": {"minimal"}})
|
||||
*/
|
||||
private ?Person $hostPerson = null;
|
||||
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use libphonenumber\PhoneNumber;
|
||||
|
||||
/**
|
||||
* Person Phones.
|
||||
@@ -51,9 +52,9 @@ class PersonPhone
|
||||
private Person $person;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", length=40, nullable=false)
|
||||
* @ORM\Column(type="phone_number", nullable=false)
|
||||
*/
|
||||
private string $phonenumber = '';
|
||||
private ?PhoneNumber $phonenumber = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", length=40, nullable=true)
|
||||
@@ -85,7 +86,7 @@ class PersonPhone
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
public function getPhonenumber(): string
|
||||
public function getPhonenumber(): ?PhoneNumber
|
||||
{
|
||||
return $this->phonenumber;
|
||||
}
|
||||
@@ -97,7 +98,8 @@ class PersonPhone
|
||||
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return empty($this->getDescription()) && empty($this->getPhonenumber());
|
||||
return ("" === $this->getDescription() || null === $this->getDescription())
|
||||
&& null === $this->getPhonenumber();
|
||||
}
|
||||
|
||||
public function setDate(DateTime $date): void
|
||||
@@ -115,7 +117,7 @@ class PersonPhone
|
||||
$this->person = $person;
|
||||
}
|
||||
|
||||
public function setPhonenumber(string $phonenumber): void
|
||||
public function setPhonenumber(?PhoneNumber $phonenumber): void
|
||||
{
|
||||
$this->phonenumber = $phonenumber;
|
||||
}
|
||||
|
Reference in New Issue
Block a user