Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  Change order of setters
  Add setter for the address line 3 property
  Add Doctrine annotation to the address line 3 property and remove branch alias from composer.json
  Make Address properties not nullable. Revert package name
  Always return FieldOverrides object
  Add default values to Address fields
  bump the version number
  Add missing type hints
  fix typo in the package name
  Change package name and add authors entry
  Update dependencies versions
  Update dependencies versions
  Fix changing country with different fields
  Update README.md
  Add required attribute on form
  Update php compatibility
  • Loading branch information
daften committed Dec 22, 2023
2 parents 553de62 + 2a0485b commit 7f5bc86
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 211 deletions.
226 changes: 46 additions & 180 deletions Entity/AddressEmbeddable.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,69 +11,74 @@
class AddressEmbeddable extends Address
{
/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $locale;
protected string $locale = 'und';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $givenName;
protected string $givenName = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $additionalName;
protected string $additionalName = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $familyName;
protected string $familyName = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $organization;
protected string $organization = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $addressLine1;
protected string $addressLine1 = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $addressLine2;
protected string $addressLine2 = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $postalCode;
protected string $addressLine3 = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $sortingCode;
protected string $postalCode = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $locality;
protected string $sortingCode = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $dependentLocality;
protected string $locality = '';

/**
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $administrativeArea;
protected string $dependentLocality = '';

/**
* @ORM\Column(type="string", length=2, nullable=true)
* @ORM\Column(type="string", nullable=false)
*/
protected $countryCode;
protected string $administrativeArea = '';

/**
* @ORM\Column(type="string", length=2, nullable=false)
*/
protected string $countryCode = '';

public function __toString(): string
{
Expand All @@ -93,212 +98,73 @@ public function __toString(): string
]));
}

/**
* @return string
*/
public function getLocale(): ?string
{
return $this->locale;
}

/**
* @param string $locale
*/
public function setLocale(string $locale = null): void
public function setLocale(string $locale): void
{
$this->locale = $locale;
}

/**
* @return string
*/
public function getAdditionalName(): ?string
{
return $this->additionalName;
}

/**
* @param string $additionalName
*/
public function setAdditionalName(string $additionalName = null): void
public function setAdditionalName(string $additionalName): void
{
$this->additionalName = $additionalName;
}

/**
* @return string
*/
public function getGivenName(): ?string
{
return $this->givenName;
}

/**
* @param string $givenName
*/
public function setGivenName(string $givenName = null): void
public function setGivenName(string $givenName): void
{
$this->givenName = $givenName;
}

/**
* @return string
*/
public function getFamilyName(): ?string
{
return $this->familyName;
}

/**
* @param string $familyName
*/
public function setFamilyName(string $familyName = null): void
public function setFamilyName(string $familyName): void
{
$this->familyName = $familyName;
}

/**
* @return string
*/
public function getOrganization(): ?string
{
return $this->organization;
}

/**
* @param string $organization
*/
public function setOrganization(string $organization = null): void
public function setOrganization(string $organization): void
{
$this->organization = $organization;
}

/**
* @return string
*/
public function getAddressLine1(): ?string
{
return $this->addressLine1;
}

/**
* @param string $addressLine1
*/
public function setAddressLine1($addressLine1 = null): void
public function setAddressLine1(string $addressLine1): void
{
$this->addressLine1 = $addressLine1;
}

/**
* @return string
*/
public function getAddressLine2(): ?string
{
return $this->addressLine2;
}

/**
* @param string $addressLine2
*/
public function setAddressLine2(string $addressLine2 = null): void
public function setAddressLine2(string $addressLine2): void
{
$this->addressLine2 = $addressLine2;
}

/**
* @return string
*/
public function getPostalCode(): ?string
public function setAddressLine3(string $addressLine3): void
{
return $this->postalCode;
$this->addressLine3 = $addressLine3;
}

/**
* @param string $postalCode
*/
public function setPostalCode(string $postalCode = null): void
public function setPostalCode(string $postalCode): void
{
$this->postalCode = $postalCode;
}

/**
* @return string
*/
public function getSortingCode(): ?string
{
return $this->sortingCode;
}

/**
* @param string $sortingCode
*/
public function setSortingCode(string $sortingCode = null): void
public function setSortingCode(string $sortingCode): void
{
$this->sortingCode = $sortingCode;
}

/**
* @return string
*/
public function getLocality(): ?string
{
return $this->locality;
}

/**
* @param string $locality
*/
public function setLocality(string $locality = null): void
public function setLocality(string $locality): void
{
$this->locality = $locality;
}

/**
* @return string
*/
public function getDependentLocality(): ?string
{
return $this->dependentLocality;
}

/**
* @param string $dependentLocality
*/
public function setDependentLocality(string $dependentLocality = null): void
public function setDependentLocality(string $dependentLocality): void
{
$this->dependentLocality = $dependentLocality;
}

/**
* @return string
*/
public function getAdministrativeArea(): ?string
{
return $this->administrativeArea;
}

/**
* @param string $administrativeArea
*/
public function setAdministrativeArea(string $administrativeArea = null): void
public function setAdministrativeArea(string $administrativeArea): void
{
$this->administrativeArea = $administrativeArea;
}

/**
* @return string
*/
public function getCountryCode(): ?string
{
return $this->countryCode;
}

/**
* @param string $countryCode
*/
public function setCountryCode(string $countryCode = NULL): void
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}

}
Loading

0 comments on commit 7f5bc86

Please sign in to comment.