本文整理汇总了PHP中XLite\Core\Converter::getDayStart方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::getDayStart方法的具体用法?PHP Converter::getDayStart怎么用?PHP Converter::getDayStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Converter
的用法示例。
在下文中一共展示了Converter::getDayStart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTodayStartTime
/**
* Get timestamp of current day start
*
* @return integer
*/
protected function getTodayStartTime()
{
return \XLite\Core\Converter::getDayStart();
}
示例2: getDateRange
/**
* getDateRange
*
* :FIXME: simplify
*
* @return \XLite\Core\CommonCell
*/
protected function getDateRange()
{
$result = null;
$paramDatePeriod = self::SEARCH_DATE_PERIOD;
if (isset($this->currentSearchCnd->{$paramDatePeriod})) {
$datePeriod = $this->currentSearchCnd->{$paramDatePeriod};
$startDate = null;
$endDate = \XLite\Core\Converter::time();
if ('M' === $datePeriod) {
$startDate = mktime(0, 0, 0, date('n', $endDate), 1, date('Y', $endDate));
} elseif ('W' === $datePeriod) {
$startDate = \XLite\Core\Converter::getDayStart($endDate - date('w', $endDate) * 86400);
} elseif ('D' === $datePeriod) {
$startDate = \XLite\Core\Converter::getDayStart($endDate);
} elseif ('C' === $datePeriod) {
$paramStartDate = static::SEARCH_START_DATE;
$paramEndDate = static::SEARCH_END_DATE;
$paramDateRange = static::SEARCH_DATE_RANGE;
if (!empty($this->currentSearchCnd->{$paramStartDate}) && !empty($this->currentSearchCnd->{$paramEndDate})) {
$tmpDate = strtotime($this->currentSearchCnd->{$paramStartDate});
if (false !== $tmpDate) {
$startDate = \XLite\Core\Converter::getDayStart($tmpDate);
}
$tmpDate = strtotime($this->currentSearchCnd->{$paramEndDate});
if (false !== $tmpDate) {
$endDate = \XLite\Core\Converter::getDayEnd($tmpDate);
}
} elseif (!empty($this->currentSearchCnd->{$paramDateRange})) {
list($startDate, $endDate) = \XLite\View\FormField\Input\Text\DateRange::convertToArray($this->currentSearchCnd->{$paramDateRange});
}
}
if (null !== $startDate && false !== $startDate && false !== $endDate) {
$result = new \XLite\Core\CommonCell();
$result->startDate = $startDate;
$result->endDate = $endDate;
}
}
return $result;
}
示例3: getSearchConditions
/**
* Return params list to use for search
*
* @param \XLite\Core\CommonCell $cnd Initial search conditions
*
* @return \XLite\Core\CommonCell
*/
protected function getSearchConditions(\XLite\Core\CommonCell $cnd)
{
$currentDate = static::getUserTime();
$daysOffset = abs(intval(\XLite\Core\Config::getInstance()->CDev->ProductAdvisor->na_max_days)) ?: \XLite\Module\CDev\ProductAdvisor\Main::PA_MODULE_OPTION_DEFAULT_DAYS_OFFSET;
$startDate = \XLite\Core\Converter::getDayStart($currentDate - $daysOffset * 24 * 60 * 60);
$endDate = \XLite\Core\Converter::getDayEnd($currentDate);
$cnd->{\XLite\Module\CDev\ProductAdvisor\Model\Repo\Product::P_ARRIVAL_DATE} = array($startDate, $endDate);
$cnd->{\XLite\Model\Repo\Product::P_ORDER_BY} = array('p.arrivalDate', 'DESC');
return $cnd;
}