PHP Class ValueObjects\Structure\KeyValuePair

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

Protected Properties

Property Type Description
$key ValueObjects\ValueObjectInterface
$value ValueObjects\ValueObjectInterface

Public Methods

Method Description
__construct ( ValueObjects\ValueObjectInterface $key, ValueObjects\ValueObjectInterface $value ) Returns a KeyValuePair
__toString ( ) : string Returns a string representation of the KeyValuePair in format "$key => $value"
fromNative ( ) : self Returns a KeyValuePair from native PHP arguments evaluated as strings
getKey ( ) : ValueObjects\ValueObjectInterface Returns key
getValue ( ) : ValueObjects\ValueObjectInterface Returns value
sameValueAs ( ValueObjects\ValueObjectInterface $keyValuePair ) : boolean Tells whether two KeyValuePair are equal

Method Details

__construct() public method

Returns a KeyValuePair
public __construct ( ValueObjects\ValueObjectInterface $key, ValueObjects\ValueObjectInterface $value )
$key ValueObjects\ValueObjectInterface
$value ValueObjects\ValueObjectInterface

__toString() public method

Returns a string representation of the KeyValuePair in format "$key => $value"
public __toString ( ) : string
return string

fromNative() public static method

Returns a KeyValuePair from native PHP arguments evaluated as strings
public static fromNative ( ) : self
return self

getKey() public method

Returns key
public getKey ( ) : ValueObjects\ValueObjectInterface
return ValueObjects\ValueObjectInterface

getValue() public method

Returns value
public getValue ( ) : ValueObjects\ValueObjectInterface
return ValueObjects\ValueObjectInterface

sameValueAs() public method

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

Property Details

$key protected_oe property

protected ValueObjectInterface,ValueObjects $key
return ValueObjects\ValueObjectInterface

$value protected_oe property

protected ValueObjectInterface,ValueObjects $value
return ValueObjects\ValueObjectInterface