本文整理汇总了PHP中Shop::cacheShops方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::cacheShops方法的具体用法?PHP Shop::cacheShops怎么用?PHP Shop::cacheShops使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::cacheShops方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSites
/**
* Get all site information - both Jirafe specific and general
* @return array $sites An array of site information as per Jirafe API spec
*/
public function getSites()
{
$sites = array();
// First, get the general site info from the Prestashop database
Shop::cacheShops(true);
// we must refresh cache to get last insertion
$psShops = Shop::getShops();
// Get the Jirafe specific information about Prestashop sites
$jsites = unserialize(base64_decode($this->get('sites')));
if (!empty($psShops)) {
foreach ($psShops as $psShop) {
if ($psShop['active']) {
$shopId = $psShop['id_shop'];
$site = array();
$site['external_id'] = $shopId;
$site['description'] = $psShop['name'];
$site['url'] = 'http://' . $psShop['domain'] . $psShop['uri'];
$site['timezone'] = Configuration::get('PS_TIMEZONE');
$site['currency'] = $this->_getCurrency($shopId);
if (!empty($jsites[$shopId])) {
$site += $jsites[$shopId];
}
// new sites in prestashop are created without url
// api require a valid unique url
if ($site['url'] === 'http://') {
$site['url'] = 'http://example.' . md5(time() + $site['external_id']) . '.com';
}
// Add the site to the list of sites to return
$sites[] = $site;
}
}
}
return $sites;
}
示例2: getTree
/**
* Get all groups and associated shops as subarrays
*
* @return array
*/
public static function getTree()
{
Shop::cacheShops();
return self::$shops;
}
示例3: array
} else {
$domains = null;
if ($context->shop->domain != $context->shop->domain_ssl) {
$domains = array($context->shop->domain_ssl, $context->shop->domain);
}
$cookie = new Cookie('ps-s' . $context->shop->id, '', $cookie_lifetime, $domains, false, $force_ssl);
}
}
$context->cookie = $cookie;
/* Create employee if in BO, customer else */
if (defined('_PS_ADMIN_DIR_')) {
$employee = new Employee($cookie->id_employee);
$context->employee = $employee;
/* Auth on shops are recached after employee assignation */
if ($employee->id_profile != _PS_ADMIN_PROFILE_) {
Shop::cacheShops(true);
}
$cookie->id_lang = (int) $employee->id_lang;
}
/* if the language stored in the cookie is not available language, use default language */
if (isset($cookie->id_lang) && $cookie->id_lang) {
$language = new Language($cookie->id_lang);
}
if (!isset($language) || !Validate::isLoadedObject($language)) {
$language = new Language(Configuration::get('PS_LANG_DEFAULT'));
}
$context->language = $language;
if (!defined('_PS_ADMIN_DIR_')) {
if (isset($cookie->id_customer) && (int) $cookie->id_customer) {
$customer = new Customer($cookie->id_customer);
if (!Validate::isLoadedObject($customer)) {