Ejemplo n.º 1
0
 private function updateCheckConflict(LocalTime $timeToSet, Period $periodToSet)
 {
     if ($this->time != null) {
         if ($this->time->equals($timeToSet) == false) {
             throw new DateTimeException("Conflict found: Fields resolved to different times: " . $this->time . " " . $timeToSet);
         }
         if ($this->excessDays->isZero() == false && $periodToSet->isZero() == false && $this->excessDays->equals($periodToSet) == false) {
             throw new DateTimeException("Conflict found: Fields resolved to different excess periods: " . $this->excessDays . " " . $periodToSet);
         } else {
             $this->excessDays = $periodToSet;
         }
     } else {
         $this->time = $timeToSet;
         $this->excessDays = $periodToSet;
     }
 }