public function fetchSitemapUrls() { $this->addUrl('news/index/index'); foreach ($this->newsRepository->getAll($this->date->getCurrentDateTime()) as $result) { $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN, $result['id']), $this->date->format($result['updated_at'], 'Y-m-d')); } }
/** * @inheritdoc */ public function process(array $params, \Smarty_Internal_Template $smarty) { $format = isset($params['format']) ? $params['format'] : 'long'; if (isset($params['date'])) { return $this->date->format($params['date'], $format); } return ''; }
/** * @inheritdoc */ public function fetchDataAndRenderColumn(array $column, array $dbResultRow) { $value = $this->getValue($column, $dbResultRow); if ($value !== null && $value !== $this->getDefaultValue($column)) { $field = $this->getFirstDbField($column); $column['attribute'] += ['data-order' => $this->date->format($dbResultRow[$field], 'U')]; } return $this->render($column, $value); }
public function fetchSitemapUrls() { $this->addUrl('files/index/index'); foreach ($this->categoryRepository->getAllByModuleName(Schema::MODULE_NAME) as $category) { $this->addUrl('files/index/files/cat_' . $category['id']); } foreach ($this->filesRepository->getAll($this->date->getCurrentDateTime()) as $result) { $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN, $result['id']), $this->date->format($result['updated_at'], 'Y-m-d')); } }
protected function fetchSitemapUrls() { $this->addUrl('gallery/index/index'); foreach ($this->galleryRepository->getAll($this->date->getCurrentDateTime()) as $result) { $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN_GALLERY, $result['id']), $this->date->format($result['updated_at'], 'Y-m-d')); foreach ($this->pictureRepository->getPicturesByGalleryId($result['id']) as $picture) { $this->addUrl(sprintf(Helpers::URL_KEY_PATTERN_PICTURE, $picture['id']), $this->date->format($result['updated_at'], 'Y-m-d')); } } }
/** * @param string $name * @param string $value * @param bool $showTime * * @return string */ protected function fetchSimpleDatePickerValue($name, $value, $showTime) { if ($this->request->getPost()->has($name)) { return $this->request->getPost()->get($name, ''); } elseif ($this->dateValidationRule->isValid($value) === true) { return $this->date->format($value, $this->getDateFormat($showTime)); } return $this->date->format('now', $this->getDateFormat($showTime), false); }
/** * @param string $date * @param string $format * @param string $title * * @return string */ protected function generateTimeTag($date, $format, $title = '') { $rfcDate = $this->date->format($date, 'c'); $title = !empty($title) ? ' title="' . $title . '"' : ''; return '<time datetime="' . $rfcDate . '"' . $title . '>' . $this->date->format($date, $format) . '</time>'; }