/**
  * @param PeriodInterface $period
  * @param \DateInterval $increment
  */
 public function __construct(PeriodInterface $period, \DateInterval $increment)
 {
     $this->period = $period;
     $this->increment = $increment;
     $this->current = $this->period->getFirstDate();
     $this->lastDateStr = $period->getLastDate()->format('Y-m-d');
     $this->index = 0;
     $this->isValid = true;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function key()
 {
     return $this->current->getBegin()->format('W');
 }
Exemplo n.º 3
0
 /**
  * @param PeriodInterface $period
  *
  * @return bool
  */
 public function isCrossWithPeriod(PeriodInterface $period)
 {
     return !($period->getFrom() > $this->getTo() || $period->getTo() < $this->getFrom()) ? true : false;
 }