PHP Class ValueObjects\Geography\Address

Inheritance: implements ValueObjects\ValueObjectInterface
Mostrar archivo Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Property Type Description
$city ValueObjects\StringLiteral\StringLiteral City/Town/Village
$country Country
$district ValueObjects\StringLiteral\StringLiteral District/City area
$name ValueObjects\StringLiteral\StringLiteral Name of the addressee (natural person or company)
$postalCode ValueObjects\StringLiteral\StringLiteral Postal code/P.O. Box/ZIP code
$region ValueObjects\StringLiteral\StringLiteral Region/County/State
$street Street

Public Methods

Method Description
__construct ( ValueObjects\StringLiteral\StringLiteral $name, Street $street, ValueObjects\StringLiteral\StringLiteral $district, ValueObjects\StringLiteral\StringLiteral $city, ValueObjects\StringLiteral\StringLiteral $region, ValueObjects\StringLiteral\StringLiteral $postalCode, Country $country ) Returns a new Address object
__toString ( ) : string Returns a string representation of the Address in US standard format.
fromNative ( ) : self Returns a new Address from native PHP arguments
getCity ( ) : ValueObjects\StringLiteral\StringLiteral Returns city
getCountry ( ) : Country Returns country
getDistrict ( ) : ValueObjects\StringLiteral\StringLiteral Returns district
getName ( ) : ValueObjects\StringLiteral\StringLiteral Returns addressee name
getPostalCode ( ) : ValueObjects\StringLiteral\StringLiteral Returns postal code
getRegion ( ) : ValueObjects\StringLiteral\StringLiteral Returns region
getStreet ( ) : Street Returns street
sameValueAs ( ValueObjects\ValueObjectInterface $address ) : boolean Tells whether two Address are equal

Method Details

__construct() public method

Returns a new Address object
public __construct ( ValueObjects\StringLiteral\StringLiteral $name, Street $street, ValueObjects\StringLiteral\StringLiteral $district, ValueObjects\StringLiteral\StringLiteral $city, ValueObjects\StringLiteral\StringLiteral $region, ValueObjects\StringLiteral\StringLiteral $postalCode, Country $country )
$name ValueObjects\StringLiteral\StringLiteral
$street Street
$district ValueObjects\StringLiteral\StringLiteral
$city ValueObjects\StringLiteral\StringLiteral
$region ValueObjects\StringLiteral\StringLiteral
$postalCode ValueObjects\StringLiteral\StringLiteral
$country Country

__toString() public method

Returns a string representation of the Address in US standard format.
public __toString ( ) : string
return string

fromNative() public static method

Returns a new Address from native PHP arguments
public static fromNative ( ) : self
return self

getCity() public method

Returns city
public getCity ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getCountry() public method

Returns country
public getCountry ( ) : Country
return Country

getDistrict() public method

Returns district
public getDistrict ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getName() public method

Returns addressee name
public getName ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getPostalCode() public method

Returns postal code
public getPostalCode ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getRegion() public method

Returns region
public getRegion ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getStreet() public method

Returns street
public getStreet ( ) : Street
return Street

sameValueAs() public method

Tells whether two Address are equal
public sameValueAs ( ValueObjects\ValueObjectInterface $address ) : boolean
$address ValueObjects\ValueObjectInterface
return boolean

Property Details

$city protected_oe property

City/Town/Village
protected StringLiteral,ValueObjects\StringLiteral $city
return ValueObjects\StringLiteral\StringLiteral

$country protected_oe property

protected Country,ValueObjects\Geography $country
return Country

$district protected_oe property

District/City area
protected StringLiteral,ValueObjects\StringLiteral $district
return ValueObjects\StringLiteral\StringLiteral

$name protected_oe property

Name of the addressee (natural person or company)
protected StringLiteral,ValueObjects\StringLiteral $name
return ValueObjects\StringLiteral\StringLiteral

$postalCode protected_oe property

Postal code/P.O. Box/ZIP code
protected StringLiteral,ValueObjects\StringLiteral $postalCode
return ValueObjects\StringLiteral\StringLiteral

$region protected_oe property

Region/County/State
protected StringLiteral,ValueObjects\StringLiteral $region
return ValueObjects\StringLiteral\StringLiteral

$street protected_oe property

protected Street,ValueObjects\Geography $street
return Street