本文整理汇总了PHP中Mage_Core_Model_Resource_Db_Collection_Abstract::_afterLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Resource_Db_Collection_Abstract::_afterLoad方法的具体用法?PHP Mage_Core_Model_Resource_Db_Collection_Abstract::_afterLoad怎么用?PHP Mage_Core_Model_Resource_Db_Collection_Abstract::_afterLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Resource_Db_Collection_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Resource_Db_Collection_Abstract::_afterLoad方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
/**
* Perform operations after collection load
*
* @return ADM_Warehouse_Model_CatalogInventory_Resource_Stock_Collection
*/
protected function _afterLoad()
{
if ($this->_previewFlag) {
$items = $this->getColumnValues('stock_id');
$connection = $this->getConnection();
if (count($items)) {
$select = $connection->select()->from(array('wss' => $this->getTable('adm_warehouse/stock_website')))->where('wss.stock_id IN (?)', $items);
if ($result = $connection->fetchPairs($select)) {
foreach ($this as $item) {
if (!isset($result[$item->getData('stock_id')])) {
continue;
}
if ($result[$item->getData('stock_id')] == 0) {
$websites = Mage::app()->getWebsites(false, true);
$websiteId = current($websites)->getId();
$websiteCode = key($websites);
} else {
$websiteId = $result[$item->getData('stock_id')];
$websiteCode = Mage::app()->getWebsite($websiteId)->getCode();
}
$item->setData('_first_website_id', $websiteId);
$item->setData('website_code', $websiteCode);
}
}
}
}
return parent::_afterLoad();
}
示例2: _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();
}
示例3: _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();
}
示例4: _afterLoad
protected function _afterLoad()
{
parent::_afterLoad();
foreach ($this->_items as $item) {
/** @var Firegento_FlexCms_Model_Content $item */
$item->afterLoad();
}
}
示例5: _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;
}
示例6: _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());
}
}
示例7: _afterLoad
/**
* Add stores column
*
* @return Enterprise_Banner_Model_Resource_Banner_Collection
*/
protected function _afterLoad()
{
parent::_afterLoad();
if ($this->getFlag('add_stores_column')) {
$this->_addStoresVisibility();
}
$this->walk('getTypes');
// fetch banner types from comma-separated
return $this;
}
示例8: _afterLoad
protected function _afterLoad()
{
parent::_afterLoad();
// inject campaign if available
if ($this->_campaign) {
/* @var $recipient Mzax_Emarketing_Model_Recipient */
foreach ($this as $recipient) {
$recipient->setCampaign($this->_campaign);
}
}
}
示例9: _afterLoad
/**
* Add website ids to rules data
*
* @return Mage_Rule_Model_Resource_Rule_Collection_Abstract
*/
protected function _afterLoad()
{
parent::_afterLoad();
if ($this->getFlag('add_websites_to_result') && $this->_items) {
/** @var Mage_Rule_Model_Abstract $item */
foreach ($this->_items as $item) {
$item->afterLoad();
}
}
return $this;
}
示例10: _afterLoad
protected function _afterLoad()
{
$localAttributes = array('label', 'position', 'disabled');
foreach ($this->getItems() as $image) {
foreach ($localAttributes as $localAttribute) {
if (is_null($image[$localAttribute])) {
$image[$localAttribute] = $this->_getDefaultValue($localAttribute, $image);
}
}
}
return parent::_afterLoad();
}
示例11: _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);
}
/** @var Mage_Sales_Model_Quote_Payment $item */
foreach ($this->_items as $item) {
foreach ($item->getData() as $fieldName => $fieldValue) {
$item->setData($fieldName, Mage::getSingleton('Mage_Sales_Model_Payment_Method_Converter')->decode($item, $fieldName));
}
}
return parent::_afterLoad();
}
示例12: _afterLoad
/**
* Set parent items
*
* @return Mage_Sales_Model_Resource_Quote_Address_Item_Collection
*/
protected function _afterLoad()
{
parent::_afterLoad();
/**
* Assign parent items
*/
foreach ($this as $item) {
if ($item->getParentItemId()) {
$item->setParentItem($this->getItemById($item->getParentItemId()));
}
}
return $this;
}
示例13: _afterLoad
/**
* Perform operations after collection load
*
* @return Demac_MultiLocationInventory_Model_Resource_Location_Collection
*
*/
protected function _afterLoad()
{
$items = $this->getColumnValues('id');
$connection = $this->getConnection();
if (count($items)) {
$select = $connection->select()->from(array('demac_multilocationinventory_stores' => $this->getTable('demac_multilocationinventory/stores')))->where('demac_multilocationinventory_stores.location_id IN (?)', $items);
if ($result = $connection->fetchPairs($select)) {
foreach ($this as $item) {
$stores = $this->lookupStoreIds($item->getId());
$item->setData('store_id', $stores);
}
}
}
return parent::_afterLoad();
}
示例14: _afterLoad
/**
* Redeclare after load method to add website IDs to items
*
* @return Enterprise_GiftWrapping_Model_Resource_Wrapping_Collection
*/
protected function _afterLoad()
{
parent::_afterLoad();
if ($this->getFlag('add_websites_to_result') && $this->_items) {
$select = $this->getConnection()->select()->from($this->getTable('enterprise_giftwrapping/website'), array('wrapping_id', 'website_id'))->where('wrapping_id IN (?)', array_keys($this->_items));
$websites = $this->getConnection()->fetchAll($select);
foreach ($this->_items as $item) {
$websiteIds = array();
foreach ($websites as $website) {
if ($item->getId() == $website['wrapping_id']) {
$websiteIds[] = $website['website_id'];
}
}
if (count($websiteIds)) {
$item->setWebsiteIds($websiteIds);
}
}
}
return $this;
}
示例15: _afterLoad
/**
* Fill array of options by item and product
*
* @return Mage_Wishlist_Model_Resource_Item_Option_Collection
*/
protected function _afterLoad()
{
parent::_afterLoad();
foreach ($this as $option) {
$optionId = $option->getId();
$itemId = $option->getWishlistItemId();
$productId = $option->getProductId();
if (isset($this->_optionsByItem[$itemId])) {
$this->_optionsByItem[$itemId][] = $optionId;
} else {
$this->_optionsByItem[$itemId] = array($optionId);
}
if (isset($this->_optionsByProduct[$productId])) {
$this->_optionsByProduct[$productId][] = $optionId;
} else {
$this->_optionsByProduct[$productId] = array($optionId);
}
}
return $this;
}