Horde_Date_Repeater_DayName::this PHP Method

this() public method

public this ( $pointer = 'future' )
    public function this($pointer = 'future')
    {
        parent::next($pointer);
        if ($pointer == 'none') {
            $pointer = 'future';
        }
        return $this->next($pointer);
    }

Usage Example

Exemplo n.º 1
0
 public function this($pointer = 'future')
 {
     parent::this($pointer);
     switch ($pointer) {
         case 'future':
             $thisWeekStart = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour + 1));
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $thisSundaySpan = $sundayRepeater->this('future');
             $thisWeekEnd = $thisSundaySpan->begin;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
         case 'past':
             $thisWeekEnd = new Horde_Date(array('year' => $this->now->year, 'month' => $this->now->month, 'day' => $this->now->day, 'hour' => $this->now->hour));
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $lastSundaySpan = $sundayRepeater->next('past');
             $thisWeekStart = $lastSundaySpan->begin;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
         case 'none':
             $sundayRepeater = new Horde_Date_Repeater_DayName('sunday');
             $sundayRepeater->now = $this->now;
             $lastSundaySpan = $sundayRepeater->next('past');
             $thisWeekStart = $lastSundaySpan->begin;
             $thisWeekEnd = clone $thisWeekStart;
             $thisWeekEnd->day += 7;
             return new Horde_Date_Span($thisWeekStart, $thisWeekEnd);
     }
 }
All Usage Examples Of Horde_Date_Repeater_DayName::this