Public Member Functions | |
addIdFilter ($ids) | |
setLoadDefault ($loadDefault) | |
getLoadDefault () | |
toOptionArray () | |
toOptionHash () | |
load ($printQuery=false, $logQuery=false) | |
joinGroupAndStore () | |
Protected Member Functions | |
_construct () | |
Protected Attributes | |
$_loadDefault = false | |
$_map = array('fields' => array('website_id' => 'main_table.website_id')) |
Definition at line 34 of file Collection.php.
_construct | ( | ) | [protected] |
Initialization here
Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.
Definition at line 40 of file Collection.php.
00041 { 00042 $this->_init('core/website'); 00043 }
addIdFilter | ( | $ | ids | ) |
Definition at line 45 of file Collection.php.
00046 { 00047 if (is_array($ids)) { 00048 if (empty($ids)) { 00049 $this->addFieldToFilter('website_id', null); 00050 } 00051 else { 00052 $this->addFieldToFilter('website_id', array('in'=>$ids)); 00053 } 00054 } 00055 else { 00056 $this->addFieldToFilter('website_id', $ids); 00057 } 00058 return $this; 00059 }
getLoadDefault | ( | ) |
joinGroupAndStore | ( | ) |
Definition at line 94 of file Collection.php.
00095 { 00096 $this->_idFieldName = 'website_group_store'; 00097 $this->getSelect()->joinLeft( 00098 array('group_table' => $this->getTable('core/store_group')), 00099 'main_table.website_id=group_table.website_id', 00100 array('group_id'=>'group_id', 'group_title'=>'name') 00101 )->joinLeft( 00102 array('store_table' => $this->getTable('core/store')), 00103 'group_table.group_id=store_table.group_id', 00104 array('store_id'=>'store_id', 'store_title'=>'name') 00105 ); 00106 $this->addOrder('group_table.name', 'ASC') // store name 00107 ->addOrder('CASE WHEN store_table.store_id = 0 THEN 0 ELSE 1 END', 'ASC') // view is admin 00108 ->addOrder('store_table.sort_order', 'ASC') // view sort order 00109 ->addOrder('store_table.name', 'ASC') // view name 00110 ; 00111 return $this; 00112 }
load | ( | $ | printQuery = false , |
|
$ | logQuery = false | |||
) |
Load data
Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.
Definition at line 82 of file Collection.php.
00083 { 00084 if (!$this->getLoadDefault()) { 00085 $this->getSelect()->where($this->getConnection()->quoteInto('main_table.website_id>?', 0)); 00086 } 00087 $this->unshiftOrder('main_table.name', 'ASC') // website name SECOND 00088 ->unshiftOrder('main_table.sort_order', 'ASC') // website sort order FIRST 00089 ; 00090 parent::load($printQuery, $logQuery); 00091 return $this; 00092 }
setLoadDefault | ( | $ | loadDefault | ) |
toOptionArray | ( | ) |
Reimplemented from Varien_Data_Collection.
Definition at line 72 of file Collection.php.
00073 { 00074 return $this->_toOptionArray('website_id', 'name'); 00075 }
toOptionHash | ( | ) |
Reimplemented from Varien_Data_Collection.
Definition at line 77 of file Collection.php.
00078 { 00079 return $this->_toOptionHash('website_id', 'name'); 00080 }
$_loadDefault = false [protected] |
Definition at line 36 of file Collection.php.