Public Member Functions | |
setStores ($stores) | |
getStoreCollection () | |
getStores () | |
getStoreIds () | |
getStoreCodes () | |
getStoresCount () | |
getDefaultStore () | |
setWebsite (Mage_Core_Model_Website $website) | |
getWebsite () | |
isCanDelete () | |
getDefaultStoreId () | |
getRootCategoryId () | |
getWebsiteId () | |
isReadOnly ($value=null) | |
Public Attributes | |
const | CACHE_TAG = 'store_group' |
Protected Member Functions | |
_construct () | |
_loadStores () | |
_beforeDelete () | |
Protected Attributes | |
$_cacheTag = true | |
$_eventPrefix = 'store_group' | |
$_eventObject = 'store_group' | |
$_stores | |
$_storeIds = array() | |
$_storeCodes = array() | |
$_storesCount = 0 | |
$_defaultStore | |
$_website |
Definition at line 35 of file Group.php.
_beforeDelete | ( | ) | [protected] |
Processing object before delete data
Reimplemented from Mage_Core_Model_Abstract.
Definition at line 276 of file Group.php.
00277 { 00278 $this->_protectFromNonAdmin(); 00279 return parent::_beforeDelete(); 00280 }
_construct | ( | ) | [protected] |
init model
Reimplemented from Varien_Object.
Definition at line 102 of file Group.php.
00103 { 00104 $this->_init('core/store_group'); 00105 }
_loadStores | ( | ) | [protected] |
Load store collection and set internal data
Definition at line 111 of file Group.php.
00112 { 00113 $this->_stores = array(); 00114 $this->_storesCount = 0; 00115 foreach ($this->getStoreCollection() as $store) { 00116 $this->_stores[$store->getId()] = $store; 00117 $this->_storeIds[$store->getId()] = $store->getId(); 00118 $this->_storeCodes[$store->getId()] = $store->getCode(); 00119 if ($this->getDefaultStoreId() == $store->getId()) { 00120 $this->_defaultStore = $store; 00121 } 00122 $this->_storesCount ++; 00123 } 00124 }
getDefaultStore | ( | ) |
Retrieve default store model
Definition at line 210 of file Group.php.
00211 { 00212 if (!$this->getDefaultStoreId()) { 00213 return false; 00214 } 00215 if (is_null($this->_stores)) { 00216 $this->_loadStores(); 00217 } 00218 return $this->_defaultStore; 00219 }
getDefaultStoreId | ( | ) |
getRootCategoryId | ( | ) |
getStoreCodes | ( | ) |
Retrieve website store codes
Definition at line 189 of file Group.php.
00190 { 00191 if (is_null($this->_stores)) { 00192 $this->_loadStores(); 00193 } 00194 return $this->_storeCodes; 00195 }
getStoreCollection | ( | ) |
Retrieve new (not loaded) Store collection object with group filter
Definition at line 151 of file Group.php.
00152 { 00153 return Mage::getModel('core/store') 00154 ->getCollection() 00155 ->addGroupFilter($this->getId()); 00156 }
getStoreIds | ( | ) |
Retrieve website store ids
Definition at line 176 of file Group.php.
00177 { 00178 if (is_null($this->_stores)) { 00179 $this->_loadStores(); 00180 } 00181 return $this->_storeIds; 00182 }
getStores | ( | ) |
Retrieve wersite store objects
Definition at line 163 of file Group.php.
00164 { 00165 if (is_null($this->_stores)) { 00166 $this->_loadStores(); 00167 } 00168 return $this->_stores; 00169 }
getStoresCount | ( | ) |
Definition at line 197 of file Group.php.
00198 { 00199 if (is_null($this->_stores)) { 00200 $this->_loadStores(); 00201 } 00202 return $this->_storesCount; 00203 }
getWebsite | ( | ) |
Retrieve website model
Definition at line 236 of file Group.php.
00237 { 00238 if (is_null($this->getWebsiteId())) { 00239 return false; 00240 } 00241 if (is_null($this->_website)) { 00242 $this->_website = Mage::app()->getWebsite($this->getWebsiteId()); 00243 } 00244 return $this->_website; 00245 }
getWebsiteId | ( | ) |
isCanDelete | ( | ) |
Is can delete group
Definition at line 252 of file Group.php.
00253 { 00254 if (!$this->getId()) { 00255 return false; 00256 } 00257 00258 return $this->getWebsite()->getDefaultGroupId() != $this->getId(); 00259 }
isReadOnly | ( | $ | value = null |
) |
setStores | ( | $ | stores | ) |
Set website stores
array | $stores |
Definition at line 131 of file Group.php.
00132 { 00133 $this->_stores = array(); 00134 $this->_storesCount = 0; 00135 foreach ($stores as $store) { 00136 $this->_stores[$store->getId()] = $store; 00137 $this->_storeIds[$store->getId()] = $store->getId(); 00138 $this->_storeCodes[$store->getId()] = $store->getCode(); 00139 if ($this->getDefaultStoreId() == $store->getId()) { 00140 $this->_defaultStore = $store; 00141 } 00142 $this->_storesCount ++; 00143 } 00144 }
setWebsite | ( | Mage_Core_Model_Website $ | website | ) |
Set website model
Mage_Core_Model_Website | $website |
Definition at line 226 of file Group.php.
$_cacheTag = true [protected] |
$_eventObject = 'store_group' [protected] |
$_eventPrefix = 'store_group' [protected] |