TimestampRange.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2007 by Konstantin V. Arkhipov                          *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00018     class TimestampRange extends DateRange
00019     {
00023         public static function create($start = null, $end = null)
00024         {
00025             return new self($start, $end);
00026         }
00027         
00028         public function getStartStamp() // null if start is null
00029         {
00030             if ($start = $this->getStart()) {
00031                 return $start->toStamp();
00032             }
00033             
00034             return null;
00035         }
00036         
00037         public function getEndStamp() // null if end is null
00038         {
00039             if ($end = $this->getEnd()) {
00040                 return $end->toStamp();
00041             }
00042             
00043             return null;
00044         }
00045         
00049         public function toTimestampRange()
00050         {
00051             return $this;
00052         }
00053         
00054         protected function getObjectName()
00055         {
00056             return 'Timestamp';
00057         }
00058     }
00059 ?>