PHP Class ValueObjects\Geography\Street

Inheritance: implements ValueObjects\ValueObjectInterface
Show file Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Property Type Description
$elements Building, floor and unit
$format __toString() format Use properties corresponding placeholders: %name%, %number%, %elements%
$name ValueObjects\StringLiteral\StringLiteral
$number ValueObjects\StringLiteral\StringLiteral

Public Methods

Method Description
__construct ( ValueObjects\StringLiteral\StringLiteral $name, ValueObjects\StringLiteral\StringLiteral $number, ValueObjects\StringLiteral\StringLiteral $elements = null, ValueObjects\StringLiteral\StringLiteral $format = null ) Returns a new Street object
__toString ( ) : string Returns a string representation of the StringLiteral in the format defined in the constructor
fromNative ( ) : Street Returns a new Street from native PHP string name and number.
getElements ( ) : ValueObjects\StringLiteral\StringLiteral Returns street elements
getName ( ) : ValueObjects\StringLiteral\StringLiteral Returns street name
getNumber ( ) : ValueObjects\StringLiteral\StringLiteral Returns street number
sameValueAs ( ValueObjects\ValueObjectInterface $street ) : boolean Tells whether two Street objects are equal

Method Details

__construct() public method

Returns a new Street object
public __construct ( ValueObjects\StringLiteral\StringLiteral $name, ValueObjects\StringLiteral\StringLiteral $number, ValueObjects\StringLiteral\StringLiteral $elements = null, ValueObjects\StringLiteral\StringLiteral $format = null )
$name ValueObjects\StringLiteral\StringLiteral
$number ValueObjects\StringLiteral\StringLiteral
$elements ValueObjects\StringLiteral\StringLiteral
$format ValueObjects\StringLiteral\StringLiteral

__toString() public method

Returns a string representation of the StringLiteral in the format defined in the constructor
public __toString ( ) : string
return string

fromNative() public static method

Returns a new Street from native PHP string name and number.
public static fromNative ( ) : Street
return Street

getElements() public method

Returns street elements
public getElements ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

getName() public method

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

getNumber() public method

Returns street number
public getNumber ( ) : ValueObjects\StringLiteral\StringLiteral
return ValueObjects\StringLiteral\StringLiteral

sameValueAs() public method

Tells whether two Street objects are equal
public sameValueAs ( ValueObjects\ValueObjectInterface $street ) : boolean
$street ValueObjects\ValueObjectInterface
return boolean

Property Details

$elements protected property

Building, floor and unit
protected $elements

$format protected property

__toString() format Use properties corresponding placeholders: %name%, %number%, %elements%
protected $format

$name protected property

protected StringLiteral,ValueObjects\StringLiteral $name
return ValueObjects\StringLiteral\StringLiteral

$number protected property

protected StringLiteral,ValueObjects\StringLiteral $number
return ValueObjects\StringLiteral\StringLiteral