fix fixture for address reference

This commit is contained in:
nobohan 2021-05-03 12:18:21 +02:00
parent a1895ec65f
commit 17c01d9b46
2 changed files with 20 additions and 9 deletions

View File

@ -38,7 +38,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt
}
public function getOrder() {
return 30;
return 51;
}
@ -73,8 +73,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt
LoadPostalCodes::$refs[array_rand(LoadPostalCodes::$refs)]
));
$ar->setMunicipalityCode($ar->getPostcode());
dump($ar);
$ar->setMunicipalityCode($ar->getPostcode()->getCode());
return $ar
;

View File

@ -103,18 +103,30 @@ class AddressReference
return $this;
}
public function getPostcode(): ?string
{
return $this->postcode;
}
public function setPostcode(?string $postcode): self
/**
* Set postcode
*
* @param PostalCode $postcode
*
* @return Address
*/
public function setPostcode(PostalCode $postcode = null)
{
$this->postcode = $postcode;
return $this;
}
/**
* Get postcode
*
* @return PostalCode
*/
public function getPostcode()
{
return $this->postcode;
}
public function getMunicipalityCode(): ?string
{
return $this->municipalityCode;