DateRange Class Reference
[Common wrapper and helper classes]

Date's interval implementation and accompanying utility methods. More...

Inheritance diagram for DateRange:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($start=null, $end=null)
 __clone ()
 setStart ($start)
 
Exceptions:
WrongArgumentException 

 setEnd ($end)
 
Exceptions:
WrongArgumentException 

 lazySet ($start=null, $end=null)
 
Returns:
DateRange

 dropStart ()
 
Returns:
DateRange

 dropEnd ()
 
Returns:
DateRange

 isEmpty ()
 getStart ()
 
Returns:
Date

 getEnd ()
 
Returns:
Date

 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 ()

Static Public Member Functions

static create ($start=null, $end=null)
 
Returns:
DateRange

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


Detailed Description

Date's interval implementation and accompanying utility methods.

See also:
Date

TimestampRange

Definition at line 21 of file DateRange.class.php.


Constructor & Destructor Documentation

DateRange::__construct ( start = null,
end = null 
)

Definition at line 37 of file DateRange.class.php.

References $end, $start, setEnd(), and setStart().

Here is the call graph for this function:


Member Function Documentation

static DateRange::create ( start = null,
end = null 
) [static]

Returns:
DateRange

Definition at line 32 of file DateRange.class.php.

References $end, and $start.

Referenced by CalendarMonthWeekly::__construct(), lightCopyOnClip(), and DateRangeList::makeRange().

DateRange::__clone (  ) 

Definition at line 46 of file DateRange.class.php.

DateRange::setStart ( start  ) 

Exceptions:
WrongArgumentException 

Returns:
DateRange

Definition at line 59 of file DateRange.class.php.

References $start, and checkType().

Referenced by __construct(), and lazySet().

Here is the call graph for this function:

DateRange::setEnd ( end  ) 

Exceptions:
WrongArgumentException 

Returns:
DateRange

Definition at line 78 of file DateRange.class.php.

References $end, and checkType().

Referenced by __construct(), and lazySet().

Here is the call graph for this function:

DateRange::lazySet ( start = null,
end = null 
)

Returns:
DateRange

Definition at line 95 of file DateRange.class.php.

References $end, $start, checkType(), setEnd(), and setStart().

Here is the call graph for this function:

DateRange::dropStart (  ) 

Returns:
DateRange

Definition at line 119 of file DateRange.class.php.

DateRange::dropEnd (  ) 

Returns:
DateRange

Definition at line 129 of file DateRange.class.php.

DateRange::isEmpty (  ) 

Definition at line 136 of file DateRange.class.php.

Referenced by compare(), and overlaps().

DateRange::getStart (  ) 

Returns:
Date

Implements SingleRange.

Definition at line 146 of file DateRange.class.php.

DateRange::getEnd (  ) 

Returns:
Date

Implements SingleRange.

Definition at line 154 of file DateRange.class.php.

DateRange::toDateString ( internalDelimiter = '-',
dateDelimiter = ' - ' 
)

Definition at line 159 of file DateRange.class.php.

DateRange::toString ( delimiter = ' - '  ) 

Definition at line 177 of file DateRange.class.php.

DateRange::overlaps ( DateRange range  ) 

Definition at line 192 of file DateRange.class.php.

References getEndStamp(), getStartStamp(), and isEmpty().

Referenced by clip(), and isNeighbour().

Here is the call graph for this function:

DateRange::contains ( date  ) 

Implements SingleRange.

Definition at line 246 of file DateRange.class.php.

References $end, $start, checkType(), getEndStamp(), and getStartStamp().

Here is the call graph for this function:

DateRange::split (  ) 

Definition at line 265 of file DateRange.class.php.

References $start, Assert::isFalse(), isOpen(), and Date::modify().

Here is the call graph for this function:

static DateRange::merge ( array  )  [static]

Definition at line 289 of file DateRange.class.php.

References $out, and isNeighbour().

Here is the call graph for this function:

DateRange::isNeighbour ( DateRange range  ) 

Definition at line 309 of file DateRange.class.php.

References isOpen(), Assert::isTrue(), and overlaps().

Referenced by merge().

Here is the call graph for this function:

DateRange::isOpen (  ) 

Definition at line 328 of file DateRange.class.php.

Referenced by isNeighbour(), isOneDay(), and split().

DateRange::enlarge ( DateRange range  ) 

enlarges $this by given $range, if last one is wider

Returns:
DateRange

Definition at line 338 of file DateRange.class.php.

DateRange::clip ( DateRange range  ) 

intersection of $this and given $range

Returns:
DateRange

Definition at line 364 of file DateRange.class.php.

References Assert::isTrue(), and overlaps().

Here is the call graph for this function:

DateRange::lightCopyOnClip ( DateRange range  ) 

result is read-only, no error checking

Returns:
DateRange

Definition at line 396 of file DateRange.class.php.

References create().

Here is the call graph for this function:

DateRange::getStartStamp (  ) 

Definition at line 427 of file DateRange.class.php.

Referenced by PrimitiveDateRange::checkRanges(), compare(), contains(), and overlaps().

DateRange::getEndStamp (  ) 

Definition at line 440 of file DateRange.class.php.

Referenced by PrimitiveDateRange::checkRanges(), compare(), contains(), and overlaps().

static DateRange::compare ( DateRange left,
DateRange right 
) [static]

Definition at line 453 of file DateRange.class.php.

References getEndStamp(), getStartStamp(), and isEmpty().

Here is the call graph for this function:

DateRange::isOneDay (  ) 

Definition at line 495 of file DateRange.class.php.

References isOpen().

Here is the call graph for this function:

DateRange::checkType ( value  )  [protected]

Definition at line 501 of file DateRange.class.php.

References getObjectName(), ClassUtils::isInstanceOf(), and Assert::isTrue().

Referenced by contains(), lazySet(), setEnd(), and setStart().

Here is the call graph for this function:

DateRange::getObjectName (  )  [protected]

Reimplemented in TimestampRange.

Definition at line 508 of file DateRange.class.php.

Referenced by checkType().


Member Data Documentation

DateRange::$start = null [private]

Definition at line 23 of file DateRange.class.php.

Referenced by __construct(), contains(), create(), lazySet(), setStart(), and split().

DateRange::$end = null [private]

Definition at line 24 of file DateRange.class.php.

Referenced by __construct(), contains(), create(), lazySet(), and setEnd().

DateRange::$dayStartStamp = null [private]

Definition at line 26 of file DateRange.class.php.

DateRange::$dayEndStamp = null [private]

Definition at line 27 of file DateRange.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Dec 9 21:57:13 2007 for onPHP by  doxygen 1.5.4