本文整理匯總了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;
}