PHP Class ValueObjects\Geography\Country

Inheritance: implements ValueObjects\ValueObjectInterface
显示文件 Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Property Type Description
$code ValueObjects\Geography\CountryCode

Public Methods

Method Description
__construct ( ValueObjects\Geography\CountryCode $code ) Returns a new Country object
__toString ( ) : string Returns country name as native string
fromNative ( ) : self Returns a new Country object given a native PHP string country code
getCode ( ) : ValueObjects\Geography\CountryCode Returns country code
getName ( ) : StringLiteral Returns country name
sameValueAs ( ValueObjects\ValueObjectInterface $country ) : boolean Tells whether two Country are equal

Method Details

__construct() public method

Returns a new Country object
public __construct ( ValueObjects\Geography\CountryCode $code )
$code ValueObjects\Geography\CountryCode

__toString() public method

Returns country name as native string
public __toString ( ) : string
return string

fromNative() public static method

Returns a new Country object given a native PHP string country code
public static fromNative ( ) : self
return self

getCode() public method

Returns country code
public getCode ( ) : ValueObjects\Geography\CountryCode
return ValueObjects\Geography\CountryCode

getName() public method

Returns country name
public getName ( ) : StringLiteral
return StringLiteral

sameValueAs() public method

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

Property Details

$code protected_oe property

protected CountryCode,ValueObjects\Geography $code
return ValueObjects\Geography\CountryCode