当前位置: 首页>>代码示例>>PHP>>正文


PHP Converter::getDayEnd方法代码示例

本文整理汇总了PHP中XLite\Core\Converter::getDayEnd方法的典型用法代码示例。如果您正苦于以下问题:PHP Converter::getDayEnd方法的具体用法?PHP Converter::getDayEnd怎么用?PHP Converter::getDayEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XLite\Core\Converter的用法示例。


在下文中一共展示了Converter::getDayEnd方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSourceRelatedProducts

 /**
  * Get products list
  *
  * @param integer $productId  Current product ID
  * @param array   $productIds Product ID which must be excluded from the search result
  * @param integer $maxCount   Maximum number of products
  *
  * @return array
  */
 public function getSourceRelatedProducts($productId, $productIds, $maxCount)
 {
     $result = array();
     $cnd = new \XLite\Core\CommonCell();
     if ($productIds) {
         $cnd->{\XLite\Module\XC\Upselling\Model\Repo\UpsellingProduct::SEARCH_EXCL_PRODUCT_ID} = $productIds;
     }
     $cnd->{\XLite\Module\XC\Upselling\Model\Repo\UpsellingProduct::SEARCH_PARENT_PRODUCT_ID} = $productId;
     $cnd->{\XLite\Module\XC\Upselling\Model\Repo\UpsellingProduct::SEARCH_DATE} = \XLite\Core\Converter::getDayEnd(\XLite\Base\SuperClass::getUserTime());
     $cnd->{\XLite\Module\XC\Upselling\Model\Repo\UpsellingProduct::SEARCH_LIMIT} = array(0, $maxCount + 1);
     $products = \XLite\Core\Database::getRepo('XLite\\Module\\XC\\Upselling\\Model\\UpsellingProduct')->search($cnd, false);
     foreach ($products as $product) {
         $result[] = $product->getProduct();
     }
     return $result;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:25,代码来源:Add2CartPopup.php

示例2: addDateCondition

 /**
  * Adds additional condition to the query for checking if product is up-to-date
  *
  * @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder object
  * @param string                     $alias        Entity alias OPTIONAL
  *
  * @return void
  */
 protected function addDateCondition(\Doctrine\ORM\QueryBuilder $queryBuilder, $alias = null)
 {
     if (!\XLite::isAdminZone()) {
         $alias = $alias ?: $queryBuilder->getRootAlias();
         $queryBuilder->andWhere($alias . '.arrivalDate < :now')->setParameter('now', \XLite\Core\Converter::getDayEnd(\XLite\Base\SuperClass::getUserTime()));
     }
 }
开发者ID:kewaunited,项目名称:xcart,代码行数:15,代码来源:Product.php

示例3: prepareCndInStock

 /**
  * Prepare certain search condition
  *
  * @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
  * @param string                     $value        Condition data
  *
  * @return void
  */
 protected function prepareCndInStock(\Doctrine\ORM\QueryBuilder $queryBuilder, $value)
 {
     if ($value) {
         $queryBuilder->innerJoinInventory()->andWhere('i.amount > :zero OR i.enabled = 0')->setParameter('zero', 0)->andWhere('p.arrivalDate < :now')->setParameter('now', \XLite\Core\Converter::getDayEnd(\XLite\Base\SuperClass::getUserTime()));
     }
 }
开发者ID:kewaunited,项目名称:xcart,代码行数:14,代码来源:Product.php

示例4: 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;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:46,代码来源:Profile.php

示例5: 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 = \XLite\Core\Converter::getDayEnd(\XLite\Base\SuperClass::getUserTime());
     $cnd->{\XLite\Module\CDev\ProductAdvisor\Model\Repo\Product::P_ARRIVAL_DATE} = array($currentDate, null);
     $cnd->{\XLite\Model\Repo\Product::P_ORDER_BY} = array('p.arrivalDate', 'ASC');
     return $cnd;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:14,代码来源:AComingSoon.php

示例6: 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;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:17,代码来源:ANewArrivals.php


注:本文中的XLite\Core\Converter::getDayEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。