Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dfddfeaf27
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (30 sloc) 0.773 kb
namespace FreeAgent\Bitter\UnitOfTime;
use \DateTime;
use \Exception;
* @author Jérémy Romey <>
abstract class AbstractUnitOfTime
protected $eventName;
protected $dateTime;
public function __construct($eventName, DateTime $dateTime = null)
$this->eventName = $eventName;
$this->dateTime = is_null($dateTime) ? new DateTime : $dateTime;
public function getUnitOfTimeName()
return $this->eventName;
public function getDateTime()
return $this->dateTime;
abstract public function getDateTimeFormated();
public function getKey()
return sprintf('%s:%s', $this->getUnitOfTimeName(), $this->getDateTimeFormated());
Jump to Line
Something went wrong with that request. Please try again.