PHP Class ValueObjects\DateTime\TimeZone

Inheritance: implements ValueObjects\ValueObjectInterface
Datei anzeigen Open project: nicolopignatelli/valueobjects Class Usage Examples

Protected Properties

Property Type Description
$name ValueObjects\StringLiteral\StringLiteral

Public Methods

Method Description
__construct ( ValueObjects\StringLiteral\StringLiteral $name ) Returns a new TimeZone object
__toString ( ) : string Returns timezone name as string
fromDefault ( ) : self Returns default TimeZone
fromNative ( ) : self Returns a new Time object from native timezone name
fromNativeDateTimeZone ( DateTimeZone $timezone ) : self Returns a new Time from a native PHP \DateTime
getName ( ) : ValueObjects\StringLiteral\StringLiteral Returns timezone name
sameValueAs ( ValueObjects\ValueObjectInterface $timezone ) : boolean Tells whether two DateTimeZone are equal by comparing their names
toNativeDateTimeZone ( ) : DateTimeZone Returns a native PHP \DateTimeZone version of the current TimeZone.

Method Details

__construct() public method

Returns a new TimeZone object
public __construct ( ValueObjects\StringLiteral\StringLiteral $name )
$name ValueObjects\StringLiteral\StringLiteral

__toString() public method

Returns timezone name as string
public __toString ( ) : string
return string

fromDefault() public static method

Returns default TimeZone
public static fromDefault ( ) : self
return self

fromNative() public static method

Returns a new Time object from native timezone name
public static fromNative ( ) : self
return self

fromNativeDateTimeZone() public static method

Returns a new Time from a native PHP \DateTime
public static fromNativeDateTimeZone ( DateTimeZone $timezone ) : self
$timezone DateTimeZone
return self

getName() public method

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

sameValueAs() public method

Tells whether two DateTimeZone are equal by comparing their names
public sameValueAs ( ValueObjects\ValueObjectInterface $timezone ) : boolean
$timezone ValueObjects\ValueObjectInterface
return boolean

toNativeDateTimeZone() public method

Returns a native PHP \DateTimeZone version of the current TimeZone.
public toNativeDateTimeZone ( ) : DateTimeZone
return DateTimeZone

Property Details

$name protected_oe property

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