/**
  * @param \ride\app\orm\openingschedule\entry\OpeningHourEntry $openingHour 
  * @return null
  */
 public function setOpeningHour(AliasOpeningHourEntry $openingHour = NULL)
 {
     $isClean = false;
     if (!$this->openingHour && !$openingHour || $this->openingHour && $openingHour && $this->openingHour->getId() === $openingHour->getId()) {
         $isClean = true;
     }
     $this->openingHour = $openingHour;
     if (!$isClean && $this->entryState === self::STATE_CLEAN) {
         $this->entryState = self::STATE_DIRTY;
     }
 }
 /**
  * @param \ride\app\orm\openingschedule\entry\OpeningHourEntry $openingHour 
  * @return null
  */
 public function setOpeningHour(OpeningHourEntry $openingHour = NULL)
 {
     if (!isset($this->loadedFields['openingHour'])) {
         $this->loadProperties();
     }
     $oldValue = null;
     if (array_key_exists('openingHour', $this->loadedValues)) {
         $oldValue = $this->loadedValues['openingHour'];
     }
     if (!$oldValue && !$openingHour || $oldValue && $openingHour && $oldValue->getId() === $openingHour->getId()) {
         $this->openingHour = $openingHour;
         return;
     }
     return parent::setOpeningHour($openingHour);
 }
Пример #3
0
 /**
  * @return time
  */
 public function getTo()
 {
     if (!isset($this->loadedFields['to'])) {
         $this->loadProperties();
     }
     return parent::getTo();
 }
Пример #4
0
 /**
  * @param \ride\app\orm\openingschedule\entry\OpeningHourEntry $entry
  * @return null
  */
 public function removeFromOpeningHours(AliasOpeningHourEntry $entry)
 {
     $this->getOpeningHours();
     $status = false;
     foreach ($this->openingHours as $openingHoursIndex => $openingHoursValue) {
         if ($openingHoursValue === $entry || $openingHoursValue->getId() === $entry->getId()) {
             unset($this->openingHours[$openingHoursIndex]);
             $status = true;
             break;
         }
     }
     if ($status && $this->entryState === self::STATE_CLEAN) {
         $this->entryState = self::STATE_DIRTY;
     }
     return $status;
 }