Overview

Packages

  • Date

Classes

  • Horde_Date
  • Horde_Date_Exception
  • Horde_Date_Recurrence
  • Horde_Date_Repeater
  • Horde_Date_Repeater_Day
  • Horde_Date_Repeater_DayName
  • Horde_Date_Repeater_DayPortion
  • Horde_Date_Repeater_Fortnight
  • Horde_Date_Repeater_Hour
  • Horde_Date_Repeater_Minute
  • Horde_Date_Repeater_Month
  • Horde_Date_Repeater_MonthName
  • Horde_Date_Repeater_Season
  • Horde_Date_Repeater_SeasonName
  • Horde_Date_Repeater_Second
  • Horde_Date_Repeater_Time
  • Horde_Date_Repeater_Week
  • Horde_Date_Repeater_Weekend
  • Horde_Date_Repeater_Year
  • Horde_Date_Span
  • Horde_Date_Translation
  • Horde_Date_Utils

Exceptions

  • Horde_Date_Repeater_Exception
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Copyright 2009-2012 Horde LLC (http://www.horde.org/)
 4:  *
 5:  * See the enclosed file COPYING for license information (LGPL). If you
 6:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
 7:  *
 8:  * @category Horde
 9:  * @package  Date
10:  */
11: 
12: /**
13:  * @category Horde
14:  * @package  Date
15:  */
16: abstract class Horde_Date_Repeater
17: {
18:     public $now;
19: 
20:     /**
21:      * returns the width (in seconds or months) of this repeatable.
22:      */
23:     abstract public function width();
24: 
25:     /**
26:      * returns the next occurance of this repeatable.
27:      */
28:     public function next($pointer = 'future')
29:     {
30:         if (is_null($this->now)) {
31:             throw new Horde_Date_Repeater_Exception('Start point must be set before calling next()');
32:         }
33: 
34:         if (!in_array($pointer, array('future', 'none', 'past'))) {
35:             throw new Horde_Date_Repeater_Exception("First argument 'pointer' must be one of 'past', 'future', 'none'");
36:         }
37:     }
38: 
39:     public function this($pointer = 'future')
40:     {
41:         if (is_null($this->now)) {
42:             throw new Horde_Date_Repeater_Exception('Start point must be set before calling this()');
43:         }
44: 
45:         if (!in_array($pointer, array('future', 'none', 'past'))) {
46:             throw new Horde_Date_Repeater_Exception("First argument 'pointer' must be one of 'past', 'future', 'none'");
47:         }
48:     }
49: 
50:     public function __toString()
51:     {
52:         return 'repeater';
53:     }
54: 
55: }
56: 
API documentation generated by ApiGen