mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
address: fix saving of isNoAddress
This commit is contained in:
parent
f92d710a26
commit
4f49292178
@ -132,6 +132,7 @@ class Address
|
||||
/**
|
||||
* True if the address is a "no address", aka homeless person, ...
|
||||
* @groups({"write"})
|
||||
* @ORM\Column(type="boolean")
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
@ -298,7 +299,7 @@ class Address
|
||||
* @param bool $isNoAddress
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsNoAddress(bool $isNoAddress)
|
||||
public function setIsNoAddress(bool $isNoAddress): self
|
||||
{
|
||||
$this->isNoAddress = $isNoAddress;
|
||||
return $this;
|
||||
|
@ -14,7 +14,7 @@ class AddressNormalizer implements NormalizerAwareInterface, NormalizerInterface
|
||||
public function normalize($address, string $format = null, array $context = [])
|
||||
{
|
||||
$data['address_id'] = $address->getId();
|
||||
$data['text'] = $address->getStreet().', '.$address->getStreetNumber();
|
||||
$data['text'] = $address->isNoAddress() ? '' : $address->getStreet().', '.$address->getStreetNumber();
|
||||
$data['street'] = $address->getStreet();
|
||||
$data['streetNumber'] = $address->getStreetNumber();
|
||||
$data['postcode']['name'] = $address->getPostCode()->getName();
|
||||
|
Loading…
x
Reference in New Issue
Block a user