= $time1) { $time[0] = null; $time[1] = null; } else { $dataPresent = true; } } else { $time[0] = null; $time[1] = null; } } if (!$dataPresent) { unset($data['opening_hours']); } } return $data; } public function isWorkday($date, ?array $countries = null) { if (empty($this->custom_data['opening_hours'])) { return parent::isWorkday($date); } static $holidays = null; if (is_null($holidays)) { $holidays = Yasumi\Yasumi::create('CzechRepublic', $date->format('Y')); } if ($holidays->isHoliday($date)) { return false; } if (!empty($this->custom_data['opening_hours'][$date->format('N')][1])) { return true; } return false; } public function isOpen(): bool { $is_open = false; if (!empty($this->custom_data['opening_hours'])) { $result = DateUtil::isOpen($this->custom_data['opening_hours']); $this->is_open = $result['is_open_today']; $is_open = $result['is_open']; } return $is_open; } public function createFromArray($row) { parent::createFromArray($row); if (!$this->time_hours && !empty($this->custom_data)) { $dayofweek = (new DateTime())->format('N'); if (isset($this->custom_data['opening_hours'][$dayofweek][1])) { $this->time_hours = $this->custom_data['opening_hours'][$dayofweek][1]; } } } }