コード例 #1
0
 /**
  * Takes a date and returns working hours or null(off work) on that particular date given.
  *
  * @param   string   $date        a date in date format
  * @throws \InvalidArgumentException
  * @thows  ShiftPattern_ArrayNotSet_Exeption
  * @return array|null                    array contains start and end time of a shift (eg. array('07:00', '15:00')), if off work returns null
  */
 public function day($date)
 {
     if ($this->_pattern === null) {
         throw new ShiftPatternFilter_ArrayNotSet_Exception();
     }
     // set a date for which you want to get working hours
     $this->_patternDate->set($date);
     $week = $this->_patternDate->week($this->_weeksInPattern);
     $day = $this->_patternDate->day();
     return $this->_pattern[$week][$day];
 }
コード例 #2
0
 public function setDate(ShiftPatternDate $shiftPatternDate)
 {
     $startPosition = $shiftPatternDate->week(count($this->array));
     $this->setStart($startPosition);
     return $this;
 }