コード例 #1
0
ファイル: Period.php プロジェクト: ebussola/common
 public function __construct(\DateTime $start, $interval, $end)
 {
     if (!$interval instanceof \DateInterval) {
         $interval = new \DateInterval("P{$interval}D");
     }
     if (!$end instanceof \DateTime) {
         $recurrences = $end;
         $end = clone $start;
         for ($i = 0; $i <= $recurrences; $i++) {
             $end = $end->add($interval);
         }
     }
     $this->start = $start;
     $this->end = $end;
     $this->interval = $interval;
     parent::__construct($start, $interval, $end);
 }
コード例 #2
0
 public function __construct(\DateTime $start, \DateInterval $interval, \DateTime $end)
 {
     parent::__construct($start, $interval, $end);
     $this->start = $start;
     $this->end = $end;
 }