本文整理汇总了PHP中Mage_Core_Model_Resource_Db_Collection_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Resource_Db_Collection_Abstract类的具体用法?PHP Mage_Core_Model_Resource_Db_Collection_Abstract怎么用?PHP Mage_Core_Model_Resource_Db_Collection_Abstract使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Core_Model_Resource_Db_Collection_Abstract类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
/**
* Unserialize additional_information in each item
*
* @return Mage_Core_Model_Resource_Db_Collection_Abstract
*/
protected function _afterLoad()
{
foreach ($this->_items as $item) {
$this->getResource()->unserializeFields($item);
}
return parent::_afterLoad();
}
示例2: _renderFiltersBefore
/**
* Join store relation table data if store filter is used
*
* @return Scandi_MenuManager_Model_Resource_Menu_Collection
*/
protected function _renderFiltersBefore()
{
if ($this->getFilter('store_id')) {
$this->getSelect()->join(array('store_table' => $this->getTable('scandi_menumanager/menu_store')), 'main_table.menu_id = store_table.menu_id', array())->group('main_table.menu_id');
}
return parent::_renderFiltersBefore();
}
示例3: _renderFiltersBefore
/**
* Join store relation table if there is store filter
*/
protected function _renderFiltersBefore()
{
if ($this->getFilter('store')) {
$this->getSelect()->join(array('store_table' => $this->getTable('mgs_storelocator/storelocator_store')), 'main_table.storelocator_id = store_table.storelocator_id', array());
}
return parent::_renderFiltersBefore();
}
示例4: addItem
/**
* Don't add item to the collection if only fixed are allowed and its carrier is not fixed
*
* @param Mage_Sales_Model_Quote_Address_Rate $rate
* @return Mage_Sales_Model_Resource_Quote_Address_Rate_Collection
*/
public function addItem(Varien_Object $rate)
{
if ($this->_allowFixedOnly && (!$rate->getCarrierInstance() || !$rate->getCarrierInstance()->isFixed())) {
return $this;
}
return parent::addItem($rate);
}
示例5: _afterLoad
/**
* Call afterLoad method for each item
*
* @return Enterprise_ImportExport_Model_Resource_Scheduled_Operation_Collection
*/
protected function _afterLoad()
{
foreach ($this->_items as $item) {
$item->afterLoad();
}
return parent::_afterLoad();
}
示例6: __construct
/**
* Collection constructor
*
* @param Mage_Core_Model_Resource_Db_Abstract $resource
* @param array $data
* @throws InvalidArgumentException
*/
public function __construct($resource = null, $data = array())
{
$this->_app = isset($data['app']) ? $data['app'] : Mage::app();
if (!$this->_app instanceof Mage_Core_Model_App) {
throw new InvalidArgumentException('Required app object is invalid');
}
parent::__construct($resource);
}
示例7: _initSelect
/**
* Initialize select object
*
* @return Mage_Directory_Model_Resource_Region_Collection
*/
protected function _initSelect()
{
parent::_initSelect();
$locale = Mage::app()->getLocale()->getLocaleCode();
$this->addBindParam(':region_locale', $locale);
$this->getSelect()->joinLeft(array('rname' => $this->_regionNameTable), 'main_table.region_id = rname.region_id AND rname.locale = :region_locale', array('name'));
return $this;
}
示例8: addFieldToFilter
/**
* Redefine default filters
*
* @param string $field
* @param mixed $condition
* @return Varien_Data_Collection_Db
*/
public function addFieldToFilter($field, $condition = null)
{
if ($field == 'stores') {
return $this->addStoreFilter($condition);
} else {
return parent::addFieldToFilter($field, $condition);
}
}
示例9: load
/**
* Loads collection
*
* @param bool $printQuery
* @param bool $logQuery
* @return Mage_Tag_Model_Resource_Popular_Collection
*/
public function load($printQuery = false, $logQuery = false)
{
if ($this->isLoaded()) {
return $this;
}
parent::load($printQuery, $logQuery);
return $this;
}
示例10: _afterLoad
protected function _afterLoad()
{
parent::_afterLoad();
foreach ($this->_items as $item) {
/** @var Firegento_FlexCms_Model_Content $item */
$item->afterLoad();
}
}
示例11: _initSelect
/**
* Initialize select, add country iso3 code and region name
*
* @return void
*/
public function _initSelect()
{
parent::_initSelect();
$this->_select->joinLeft(array('country_table' => $this->_countryTable), 'country_table.country_id = main_table.dest_country_id', array('dest_country' => 'iso3_code'))->joinLeft(array('region_table' => $this->_regionTable), 'region_table.region_id = main_table.dest_region_id', array('dest_region' => 'code'));
$this->addOrder('dest_country', self::SORT_ORDER_ASC);
$this->addOrder('dest_region', self::SORT_ORDER_ASC);
$this->addOrder('dest_zip', self::SORT_ORDER_ASC);
$this->addOrder('condition_value', self::SORT_ORDER_ASC);
}
示例12: _afterLoad
/**
* join content from firegento_flexcms/content 1:1
*/
protected function _afterLoad()
{
parent::_afterLoad();
foreach ($this->_items as $item) {
/** @var Firegento_FlexCms_Model_Content_Link $item */
$item->setStoreId($this->_storeId);
$item->addData($item->getContentModel()->getData());
}
}
示例13: _afterLoadData
/**
* @return $this
*/
protected function _afterLoadData()
{
foreach ($this->_data as $data) {
if (isset($data['additional']) && strlen($data['additional'])) {
$data['additional'] = Mage::helper('core')->jsonDecode($data['additional']);
}
}
parent::_afterLoadData();
}
示例14: _renderFilters
protected function _renderFilters()
{
if ($this->_isFiltersRendered) {
return $this;
}
parent::_renderFilters();
$this->_select->where('is_removed = 0');
return $this;
}
示例15: _afterLoad
/**
* After load processing
*
* @return Enterprise_GiftRegistry_Model_Resource_Item_Collection
*/
protected function _afterLoad()
{
parent::_afterLoad();
// Assign options and products
$this->_assignOptions();
$this->_assignProducts();
$this->resetItemsDataChanged();
return $this;
}