[address] allow to add custom data on addresses

This commit is contained in:
2021-03-08 14:11:39 +01:00
parent 14d32aa763
commit 5bf9bbc22e
9 changed files with 172 additions and 17 deletions

View File

@@ -44,6 +44,13 @@ class Address
*/
private $isNoAddress = false;
/**
* A list of metadata, added by customizable fields
*
* @var array
*/
private $customs = [];
public function __construct()
{
$this->validFrom = new \DateTime();
@@ -183,6 +190,29 @@ class Address
return $this;
}
/**
* Get customs informations in the address
*
* @return array
*/
public function getCustoms(): array
{
return $this->customs;
}
/**
* Store custom informations in the address
*
* @param array $customs
* @return $this
*/
public function setCustoms(array $customs): self
{
$this->customs = $customs;
return $this;
}
/**
* Validate the address.
*