コード例 #1
0
 /**
  * @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;
     }
 }
コード例 #2
0
 /**
  * @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);
 }
コード例 #3
0
ファイル: OpeningScheduleEntry.php プロジェクト: brendt/ridme
 /**
  * @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;
 }
コード例 #4
0
ファイル: HolidayEntryProxy.php プロジェクト: brendt/ridme
 /**
  * @return integer
  */
 public function getTo()
 {
     if (!isset($this->loadedFields['to'])) {
         $this->loadProperties();
     }
     return parent::getTo();
 }