Skip to content

Commit

Permalink
Added the 'name' property.
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Laviale committed Apr 9, 2014
1 parent bf1ba52 commit 0aa0297
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions lib/timezone.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,34 @@ static public function from($source)
return self::$cache[$source];
}

/**
* The name of the timezone.
*
* Note: This variable is only used to provide information during debugging.
*
* @var string
*/
private $name;

/**
* Location of the timezone.
*
* @var TimeZoneLocation
*/
private $location;

/**
* Initializes the {@link $name} property.
*
* @param string $timezone
*/
public function __construct($timezone)
{
parent::__construct($timezone);

$this->name = $this->getName();
}

/**
* Returns the {@link $location}, {@link $name} and {@link $offset} properties.
*
Expand All @@ -96,7 +117,7 @@ public function __get($property)

case 'name':

return $this->getName();
return $this->name;

case 'offset':

Expand Down Expand Up @@ -127,6 +148,6 @@ public function __get($property)
*/
public function __toString()
{
return $this->getName();
return $this->name;
}
}

0 comments on commit 0aa0297

Please sign in to comment.