/** * @param \ride\app\orm\openingschedule\entry\HolidayEntry $holiday * @return null */ public function setHoliday(AliasHolidayEntry $holiday = NULL) { $isClean = false; if (!$this->holiday && !$holiday || $this->holiday && $holiday && $this->holiday->getId() === $holiday->getId()) { $isClean = true; } $this->holiday = $holiday; if (!$isClean && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } }
/** * @param \ride\app\orm\openingschedule\entry\HolidayEntry $holiday * @return null */ public function setHoliday(HolidayEntry $holiday = NULL) { if (!isset($this->loadedFields['holiday'])) { $this->loadProperties(); } $oldValue = null; if (array_key_exists('holiday', $this->loadedValues)) { $oldValue = $this->loadedValues['holiday']; } if (!$oldValue && !$holiday || $oldValue && $holiday && $oldValue->getId() === $holiday->getId()) { $this->holiday = $holiday; return; } return parent::setHoliday($holiday); }
/** * @param \ride\app\orm\openingschedule\entry\HolidayEntry $entry * @return null */ public function removeFromHolidays(AliasHolidayEntry $entry) { $this->getHolidays(); $status = false; foreach ($this->holidays as $holidaysIndex => $holidaysValue) { if ($holidaysValue === $entry || $holidaysValue->getId() === $entry->getId()) { unset($this->holidays[$holidaysIndex]); $status = true; break; } } if ($status && $this->entryState === self::STATE_CLEAN) { $this->entryState = self::STATE_DIRTY; } return $status; }
/** * @return integer */ public function getTo() { if (!isset($this->loadedFields['to'])) { $this->loadProperties(); } return parent::getTo(); }