PHP Class ValueObjects\Geography\Country

Inheritance: implements ValueObjects\ValueObjectInterface
Afficher le fichier Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Свойство Type Description
$code ValueObjects\Geography\CountryCode

Méthodes publiques

Méthode 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 méthode

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

__toString() public méthode

Returns country name as native string
public __toString ( ) : string
Résultat string

fromNative() public static méthode

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

getCode() public méthode

Returns country code
public getCode ( ) : ValueObjects\Geography\CountryCode
Résultat ValueObjects\Geography\CountryCode

getName() public méthode

Returns country name
public getName ( ) : StringLiteral
Résultat StringLiteral

sameValueAs() public méthode

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

Property Details

$code protected_oe property

protected CountryCode,ValueObjects\Geography $code
Résultat ValueObjects\Geography\CountryCode