Date's interval implementation and accompanying utility methods. More...
Public Member Functions | |
__construct ($start=null, $end=null) | |
__clone () | |
setStart ($start) | |
safeSetStart ($start) | |
safeSetEnd ($end) | |
setEnd ($end) | |
lazySet ($start=null, $end=null) | |
dropStart () | |
dropEnd () | |
isEmpty () | |
getStart () | |
getEnd () | |
toDateString ($internalDelimiter= '-', $dateDelimiter= '- ') | |
toString ($delimiter= '- ') | |
overlaps (DateRange $range) | |
contains ($date) | |
split () | |
isNeighbour (DateRange $range) | |
isOpen () | |
enlarge (DateRange $range) | |
enlarges $this by given $range, if last one is wider | |
clip (DateRange $range) | |
intersection of $this and given $range | |
lightCopyOnClip (DateRange $range) | |
result is read-only, no error checking | |
getStartStamp () | |
getEndStamp () | |
isOneDay () | |
toTimestampRange () | |
Static Public Member Functions | |
static | create ($start=null, $end=null) |
static | merge ($array) |
static | compare (DateRange $left, DateRange $right) |
Protected Member Functions | |
checkType ($value) | |
getObjectName () | |
Private Attributes | |
$start = null | |
$end = null | |
$dayStartStamp = null | |
$dayEndStamp = null |
Date's interval implementation and accompanying utility methods.
Definition at line 20 of file DateRange.class.php.
DateRange::__construct | ( | $ | start = null , |
|
$ | end = null | |||
) |
Definition at line 36 of file DateRange.class.php.
References $end, $start, setEnd(), and setStart().
DateRange::__clone | ( | ) |
Definition at line 45 of file DateRange.class.php.
DateRange::checkType | ( | $ | value | ) | [protected] |
Definition at line 550 of file DateRange.class.php.
References getObjectName(), ClassUtils::isInstanceOf(), and Assert::isTrue().
Referenced by contains(), lazySet(), setEnd(), and setStart().
DateRange::clip | ( | DateRange $ | range | ) |
intersection of $this and given $range
Definition at line 401 of file DateRange.class.php.
References Assert::isTrue(), and overlaps().
Definition at line 490 of file DateRange.class.php.
References getEndStamp(), getStartStamp(), and isEmpty().
DateRange::contains | ( | $ | date | ) |
Implements SingleRange.
Definition at line 283 of file DateRange.class.php.
References $end, $start, checkType(), getEndStamp(), and getStartStamp().
static DateRange::create | ( | $ | start = null , |
|
$ | end = null | |||
) | [static] |
Reimplemented in TimestampRange.
Definition at line 31 of file DateRange.class.php.
Referenced by lightCopyOnClip(), DateRangeList::makeRange(), and toTimestampRange().
DateRange::dropEnd | ( | ) |
Definition at line 166 of file DateRange.class.php.
DateRange::dropStart | ( | ) |
Definition at line 156 of file DateRange.class.php.
DateRange::enlarge | ( | DateRange $ | range | ) |
enlarges $this by given $range, if last one is wider
Definition at line 375 of file DateRange.class.php.
DateRange::getEnd | ( | ) |
Implements SingleRange.
Definition at line 191 of file DateRange.class.php.
Referenced by IntervalUnit::countInRange(), TimestampRange::getEndStamp(), DateUtils::makeDatesListByRange(), safeSetStart(), and toTimestampRange().
DateRange::getEndStamp | ( | ) |
Reimplemented in TimestampRange.
Definition at line 477 of file DateRange.class.php.
Referenced by PrimitiveDateRange::checkRanges(), compare(), contains(), and overlaps().
DateRange::getObjectName | ( | ) | [protected] |
Reimplemented in TimestampRange.
Definition at line 557 of file DateRange.class.php.
Referenced by checkType().
DateRange::getStart | ( | ) |
Implements SingleRange.
Definition at line 183 of file DateRange.class.php.
Referenced by IntervalUnit::countInRange(), TimestampRange::getStartStamp(), DateUtils::makeDatesListByRange(), safeSetEnd(), and toTimestampRange().
DateRange::getStartStamp | ( | ) |
Reimplemented in TimestampRange.
Definition at line 464 of file DateRange.class.php.
Referenced by PrimitiveDateRange::checkRanges(), compare(), contains(), and overlaps().
DateRange::isEmpty | ( | ) |
Definition at line 173 of file DateRange.class.php.
Referenced by compare(), and overlaps().
DateRange::isNeighbour | ( | DateRange $ | range | ) |
Definition at line 346 of file DateRange.class.php.
References isOpen(), Assert::isTrue(), and overlaps().
DateRange::isOneDay | ( | ) |
Definition at line 532 of file DateRange.class.php.
References isOpen().
DateRange::isOpen | ( | ) |
Definition at line 365 of file DateRange.class.php.
Referenced by isNeighbour(), isOneDay(), and split().
DateRange::lazySet | ( | $ | start = null , |
|
$ | end = null | |||
) |
Definition at line 132 of file DateRange.class.php.
References $end, $start, checkType(), setEnd(), and setStart().
DateRange::lightCopyOnClip | ( | DateRange $ | range | ) |
result is read-only, no error checking
Definition at line 433 of file DateRange.class.php.
References create().
static DateRange::merge | ( | $ | array | ) | [static] |
Definition at line 326 of file DateRange.class.php.
DateRange::overlaps | ( | DateRange $ | range | ) |
Definition at line 229 of file DateRange.class.php.
References getEndStamp(), getStartStamp(), and isEmpty().
Referenced by clip(), and isNeighbour().
DateRange::safeSetEnd | ( | $ | end | ) |
Definition at line 95 of file DateRange.class.php.
References $end, Date::compare(), getStart(), and setEnd().
DateRange::safeSetStart | ( | $ | start | ) |
Definition at line 76 of file DateRange.class.php.
References $start, Date::compare(), getEnd(), and setStart().
DateRange::setEnd | ( | $ | end | ) |
WrongArgumentException |
Definition at line 115 of file DateRange.class.php.
References $end, and checkType().
Referenced by __construct(), lazySet(), and safeSetEnd().
DateRange::setStart | ( | $ | start | ) |
WrongArgumentException |
Definition at line 58 of file DateRange.class.php.
References $start, and checkType().
Referenced by __construct(), lazySet(), and safeSetStart().
DateRange::split | ( | ) |
Definition at line 302 of file DateRange.class.php.
References $start, Assert::isFalse(), isOpen(), and Date::modify().
DateRange::toDateString | ( | $ | internalDelimiter = '-' , |
|
$ | dateDelimiter = ' - ' | |||
) |
Definition at line 196 of file DateRange.class.php.
DateRange::toString | ( | $ | delimiter = ' - ' |
) |
Definition at line 214 of file DateRange.class.php.
DateRange::toTimestampRange | ( | ) |
Reimplemented in TimestampRange.
Definition at line 541 of file DateRange.class.php.
References create(), getEnd(), and getStart().
Referenced by IntervalUnit::countInRange().
DateRange::$dayEndStamp = null [private] |
Definition at line 26 of file DateRange.class.php.
DateRange::$dayStartStamp = null [private] |
Definition at line 25 of file DateRange.class.php.
DateRange::$end = null [private] |
Definition at line 23 of file DateRange.class.php.
Referenced by __construct(), contains(), TimestampRange::create(), create(), TimestampRange::getEndStamp(), lazySet(), safeSetEnd(), and setEnd().
DateRange::$start = null [private] |
Definition at line 22 of file DateRange.class.php.
Referenced by __construct(), contains(), TimestampRange::create(), create(), TimestampRange::getStartStamp(), lazySet(), safeSetStart(), setStart(), and split().