本文整理汇总了PHP中XLite::isCacheBuilding方法的典型用法代码示例。如果您正苦于以下问题:PHP XLite::isCacheBuilding方法的具体用法?PHP XLite::isCacheBuilding怎么用?PHP XLite::isCacheBuilding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite
的用法示例。
在下文中一共展示了XLite::isCacheBuilding方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: registerIfScheduled
/**
* Register CloudSearch if it has been scheduled
*
* @return void
*/
public function registerIfScheduled()
{
if ($this->isScheduled() && !\XLite::isCacheBuilding()) {
$apiClient = ServiceApiClient::getInstance();
$this->unschedule();
$apiClient->register();
}
}
示例2: addLanguageQuery
/**
* Add language subquery with language code relation
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder
* @param string $alias Main model alias OPTIONAL
* @param string $code Language code OPTIONAL
*
* @return \Doctrine\ORM\QueryBuilder
*/
protected function addLanguageQuery(\Doctrine\ORM\QueryBuilder $queryBuilder, $alias = null, $code = null, $translationsAlias = 'translations')
{
if (!isset($alias)) {
$alias = $this->getMainAlias($queryBuilder);
}
if (!isset($code)) {
$code = !\XLite::isCacheBuilding() && \XLite\Core\Session::getInstance()->getLanguage() ? \XLite\Core\Session::getInstance()->getLanguage()->getCode() : 'en';
}
$queryBuilder->leftJoin($alias . '.translations', $translationsAlias, \Doctrine\ORM\Query\Expr\Join::WITH, $translationsAlias . '.code = :lng')->setParameter('lng', $code);
return $queryBuilder;
}
示例3: getTranslationCode
/**
* Return current translation code
*
* @return string
*/
protected function getTranslationCode()
{
$code = 'en';
if (\XLite\Logic\Import\Importer::getLanguageCode()) {
$code = \XLite\Logic\Import\Importer::getLanguageCode();
} elseif (!\XLite::isCacheBuilding() && \XLite\Core\Session::getInstance()->getLanguage()) {
$code = \XLite\Core\Session::getInstance()->getLanguage()->getCode();
}
return $code;
}