OpenCart 🇺🇦

Класс ModelSettingStore extends Model { ... }

Тип Возвр. Описание
public mixed addStore ( $data )
Исходный код метода:
$this->db->query("INSERT INTO " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['config_name']) . "', `url` = '" . $this->db->escape($data['config_url']) . "', `ssl` = '" . $this->db->escape($data['config_ssl']) . "'");

$this->cache->delete('store');

return $this->db->getLastId();
public mixed editStore ( $store_id, $data )
Исходный код метода:
$this->db->query("UPDATE " . DB_PREFIX . "store SET name = '" . $this->db->escape($data['config_name']) . "', `url` = '" . $this->db->escape($data['config_url']) . "', `ssl` = '" . $this->db->escape($data['config_ssl']) . "' WHERE store_id = '" . (int)$store_id . "'");

$this->cache->delete('store');
public mixed deleteStore ( $store_id )
Исходный код метода:
$this->db->query("DELETE FROM " . DB_PREFIX . "store WHERE store_id = '" . (int)$store_id . "'");

$this->cache->delete('store');
public mixed getStore ( $store_id )
Исходный код метода:
$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "store WHERE store_id = '" . (int)$store_id . "'");

return $query->row;
public mixed getStores ( $data = array() )
Исходный код метода:
$store_data = $this->cache->get('store');

if (!$store_data) {
	$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "store ORDER BY url");

	$store_data = $query->rows;

	$this->cache->set('store', $store_data);
}

return $store_data;
public mixed getTotalStores ( )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "store");

return $query->row['total'];
public mixed getTotalStoresByLayoutId ( $layout_id )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_layout_id' AND `value` = '" . (int)$layout_id . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByLanguage ( $language )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_language' AND `value` = '" . $this->db->escape($language) . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByCurrency ( $currency )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_currency' AND `value` = '" . $this->db->escape($currency) . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByCountryId ( $country_id )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_country_id' AND `value` = '" . (int)$country_id . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByZoneId ( $zone_id )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_zone_id' AND `value` = '" . (int)$zone_id . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByCustomerGroupId ( $customer_group_id )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_customer_group_id' AND `value` = '" . (int)$customer_group_id . "' AND store_id != '0'");

return $query->row['total'];		
public mixed getTotalStoresByInformationId ( $information_id )
Исходный код метода:
$account_query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_account_id' AND `value` = '" . (int)$information_id . "' AND store_id != '0'");

$checkout_query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_checkout_id' AND `value` = '" . (int)$information_id . "' AND store_id != '0'");

return ($account_query->row['total'] + $checkout_query->row['total']);
public mixed getTotalStoresByOrderStatusId ( $order_status_id )
Исходный код метода:
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "setting WHERE `key` = 'config_order_status_id' AND `value` = '" . (int)$order_status_id . "' AND store_id != '0'");

return $query->row['total'];		

Связанные классы:

Название класса Роль
class Cache { ... } Компонент Cache используется в данном классе
class DB { ... } Компонент Db используется в данном классе

Комментарии