/**
  * Unserialize additional_information in each item
  * @return Mage_Core_Model_Mysql4_Collection_Abstract
  */
 protected function _afterLoad()
 {
     foreach ($this->_items as $item) {
         $this->getResource()->unserializeFields($item);
     }
     return parent::_afterLoad();
 }
 /**
  * @return Noovias_Cron_Model_Mysql4_Schedule_Config_Collection
  *
  *
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     /**
      * Add availible cron jobs to collection, if they are not saved in the database, but
      * don't save the collection, new db entries are creted if a cron job is edited and saved
      * via the Backend Grid (Noovias - Cronjobs -> Settings)
      */
     $availibleJobCodes = $this->helperCron()->getAvailableJobCodesAsArray();
     foreach ($availibleJobCodes as $jobCode) {
         if (!$this->getItemByColumnValue('job_code', $jobCode)) {
             /** @var $itemToAdd Noovias_Cron_Model_Schedule_Config */
             $itemToAdd = $this->getServiceInitializeConfig()->initByJobCode($jobCode, false);
             $this->addItem($itemToAdd);
         }
     }
     /**
      * Set the _totalRecords variable in order to render the cron jobs in the
      * grid (Noovias - Cronjobs -> Settings) (renders only if the getSize method
      * returns a value > 0)
      */
     $this->_totalRecords = count($this->getItems());
     /** Sort ascending by job_code */
     $items = $this->getItems();
     usort($items, array('Noovias_Cron_Model_Mysql4_Schedule_Config_Collection', 'sortByJobCode'));
     $this->_items = $items;
     return $this;
 }
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if (VPROF) {
         Varien_Profiler::start('TTT1:' . __METHOD__);
     }
     $this->_addProductAttributes();
     if (VPROF) {
         Varien_Profiler::stop('TTT1:' . __METHOD__);
     }
     if (VPROF) {
         Varien_Profiler::start('TTT2:' . __METHOD__);
     }
     $this->_addAssociatedProductFilters();
     if (VPROF) {
         Varien_Profiler::stop('TTT2:' . __METHOD__);
     }
     if (VPROF) {
         Varien_Profiler::start('TTT3:' . __METHOD__);
     }
     $this->_loadLabels();
     if (VPROF) {
         Varien_Profiler::stop('TTT3:' . __METHOD__);
     }
     if (VPROF) {
         Varien_Profiler::start('TTT4:' . __METHOD__);
     }
     $this->_loadPrices();
     if (VPROF) {
         Varien_Profiler::stop('TTT4:' . __METHOD__);
     }
     return $this;
 }
Пример #4
0
 /**
  * After load processing - adds store information to the datasets
  *
  */
 protected function _afterLoad()
 {
     if ($this->_previewFlag) {
         $items = $this->getColumnValues('verticalmenu_id');
         if (count($items)) {
             $select = $this->getConnection()->select()->from($this->getTable('ves_verticalmenu/verticalmenu_store'))->where($this->getTable('ves_verticalmenu/verticalmenu_store') . '.verticalmenu_id IN (?)', $items);
             if ($result = $this->getConnection()->fetchPairs($select)) {
                 foreach ($this as $item) {
                     if (!isset($result[$item->getData('verticalmenu_id')])) {
                         continue;
                     }
                     if ($result[$item->getData('verticalmenu_id')] == 0) {
                         $stores = Mage::app()->getStores(false, true);
                         $storeId = current($stores)->getId();
                         $storeCode = key($stores);
                     } else {
                         $storeId = $result[$item->getData('verticalmenu_id')];
                         $storeCode = Mage::app()->getStore($storeId)->getCode();
                     }
                     if ($item->getData('is_default') == 1) {
                         $this->setData('is_default', Mage::helper('ves_verticalmenu')->__('<span class="hightlight">Default</span>'));
                     } else {
                         $this->setData('is_default', Mage::helper('ves_verticalmenu')->__('No'));
                     }
                     $item->setData('_first_store_id', $storeId);
                     $item->setData('store_code', $storeCode);
                 }
             }
         }
     }
     parent::_afterLoad();
 }
Пример #5
0
 /**
  * After load processing - adds store information to the datasets
  *
  */
 protected function _afterLoad()
 {
     $connection = $this->getConnection();
     foreach ($this as $item) {
         $page_stores = array();
         if ($alias = $item->getData("alias")) {
             $cms_page = Mage::getModel("cms/page")->load($alias, "identifier");
             if ($cms_page->getPageId()) {
                 $page_stores = $cms_page->getStoreId();
                 $select = $connection->select()->from(array('cps' => $this->getTable('cms/page_store')))->where('cps.page_id = (?)', $cms_page->getPageId());
                 if ($result = $connection->fetchPairs($select)) {
                     if ($result[$cms_page->getPageId()] == 0) {
                         $stores = Mage::app()->getStores(false, true);
                         $storeId = current($stores)->getId();
                         $storeCode = key($stores);
                     } else {
                         $storeId = $result[$cms_page->getPageId()];
                         $storeCode = Mage::app()->getStore($storeId)->getCode();
                     }
                     $item->setData('_first_store_id', $storeId);
                     $item->setData('store_code', $storeCode);
                 }
                 $stores = isset($stores) && $stores ? $stores : array(0);
                 $item->setData("store_id", $page_stores);
             }
         }
     }
     parent::_afterLoad();
 }
Пример #6
0
 protected function _afterLoad()
 {
     if ($this->_previewFlag) {
         $items = $this->getColumnValues('splash_id');
         if (count($items)) {
             $select = $this->getConnection()->select()->from($this->getTable('splash/splash_store'))->where($this->getTable('splash/splash_store') . '.splash_id IN (?)', $items);
             if ($result = $this->getConnection()->fetchPairs($select)) {
                 foreach ($this as $item) {
                     if (!isset($result[$item->getData('splash_id')])) {
                         continue;
                     }
                     if ($result[$item->getData('splash_id')] == 0) {
                         $stores = Mage::app()->getStores(false, true);
                         $storeId = current($stores)->getId();
                         $storeCode = key($stores);
                     } else {
                         $storeId = $result[$item->getData('splash_id')];
                         $storeCode = Mage::app()->getStore($storeId)->getCode();
                     }
                     $item->setData('_first_store_id', $storeId);
                     $item->setData('store_code', $storeCode);
                 }
             }
         }
     }
     parent::_afterLoad();
 }
Пример #7
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $this->_loadLabels();
     $this->_loadPrices();
     return $this;
 }
Пример #8
0
 protected function _afterLoad()
 {
     foreach ($this->_items as $i) {
         $i->afterLoad();
     }
     return parent::_afterLoad();
 }
 protected function _afterLoad()
 {
     foreach ($this->_items as $model) {
         $model->setData('store_ids', explode(',', $model->getData('store_ids')));
     }
     return parent::_afterLoad();
 }
Пример #10
0
 protected function _afterLoad()
 {
     foreach ($this->_items as $_7f11b1962e14e69c8844d0655d561b3e8cd30d5b) {
         $_7f11b1962e14e69c8844d0655d561b3e8cd30d5b->correctActive();
     }
     return parent::_afterLoad();
 }
Пример #11
0
 protected function _afterLoad()
 {
     /*$items = $this->getColumnValues('post_id');
       if (count($items)) {
           $select = $this->getConnection()->select()
                   ->from($this->getTable('store'))
                   ->where($this->getTable('store').'.post_id IN (?)', $items);
           if ($result = $this->getConnection()->fetchPairs($select)) {
               foreach ($this as $item) {
                   if (!isset($result[$item->getData('post_id')])) {
                       continue;
                   }
                   if ($result[$item->getData('post_id')] == 0) {
                       $storeCode = key(Mage::app()->getStores(false, true));
                   } else {
                       $storeCode = Mage::app()->getStore($result[$item->getData('post_id')])->getCode();
                   }
                   $item->setData('store_code', $storeCode);
               }
           }
       }*/
     if (count($this) > 0) {
         Mage::dispatchEvent("fontis_blog_post_collection_load_after", array("collection" => $this));
     }
     return parent::_afterLoad();
 }
Пример #12
0
 protected function _afterLoad()
 {
     /*foreach ($this->getItems() as $item)
       {
           $item->callAfterLoad();
       }*/
     return parent::_afterLoad();
 }
Пример #13
0
 /**
  * Inflate all items in collection
  *
  * @return Mage_Core_Model_Resource_Db_Collection_Abstract
  */
 protected function _afterLoad()
 {
     /* @var Listrak_Remarketing_Model_Session $i */
     foreach ($this->_items as $i) {
         $i->afterLoad();
     }
     return parent::_afterLoad();
 }
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this->_items as $item) {
         $item->getResource()->_afterLoad($item);
     }
     return $this;
 }
Пример #15
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this->_items as $item) {
         $item->loadSerializedData();
     }
     return $this;
 }
Пример #16
0
 protected function _afterLoad()
 {
     foreach ($this as $item) {
         $stores = $this->lookupStoreIds($item->getId());
         $item->setData('store_id', $stores);
     }
     return parent::_afterLoad();
 }
Пример #17
0
 /**
  * Inflate items for reporting
  *
  * @return Mage_Core_Model_Resource_Db_Collection_Abstract
  */
 protected function _afterLoad()
 {
     /* @var Listrak_Remarketing_Model_Abandonedcart $item */
     foreach ($this->_items as $item) {
         $item->afterLoad();
     }
     return parent::_afterLoad();
 }
 /**
  * Add stores column
  *
  * @return Zeon_Faq_Model_Mysql4_Faq_Collection
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($this->getFlag('add_stores_column')) {
         $this->_addStoresVisibility();
     }
     $this->_addCategory();
     return $this;
 }
Пример #19
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this as $item) {
         $orders = $this->getResource()->lookupOrderIds($item->getId());
         $item->setData('order_id', $orders);
     }
     return $this;
 }
Пример #20
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     $currency = Mage::app()->getStore()->getCurrentCurrencyCode();
     foreach ($this->_items as $item) {
         $item->setCurrency($currency);
     }
     return $this;
 }
Пример #21
0
 protected function _afterLoad()
 {
     foreach ($this->_items as $item) {
         $item->afterLoad();
         if ($this->_prepareForReport === true) {
             $item->prepareForReport();
         }
     }
     return parent::_afterLoad();
 }
Пример #22
0
 /**
  * Add stores column
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return Enterprise_Banner_Model_Mysql4_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;
 }
Пример #23
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     // convert StoreId from string to Array
     foreach ($this->_items as $item) {
         $item->setStoreId(explode(',', $item->getStoreId()));
     }
     Mage::dispatchEvent('core_collection_abstract_load_after', array('collection' => $this));
     return $this;
 }
Пример #24
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this->getItems() as $item) {
         if ($item->hasAdditionalData() && $item->getValues()) {
             $item->setValues(Zend_Json::decode($item->getValues()));
         }
     }
     return $this;
 }
Пример #25
0
 protected function _afterLoad()
 {
     $res = $this->getFlag('unirgy_skip_afterload') ? Mage_Core_Model_Mysql4_Collection_Abstract::_afterLoad() : parent::_afterLoad();
     foreach ($this as $item) {
         if (!is_array($prices = $item->getPrices())) {
             $item->setPrices(array());
         }
     }
     return $res;
 }
Пример #26
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($this->_load_method_info) {
         foreach ($this->_items as $item) {
             $item->addPaymentInfo();
         }
     }
     return $this;
 }
Пример #27
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($storeId = $this->getStoreId()) {
         foreach ($this->_items as $item) {
             $item->setStoreId($storeId)->loadStoreValue();
         }
     }
     return $this;
 }
Пример #28
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     foreach ($this->_items as $object) {
         if (!$object->getData('identifier')) {
             $object->setData('identifier', $this->formatUrlKey($object->getValue()));
         }
     }
     return $this;
 }
Пример #29
0
 protected function _afterLoad()
 {
     foreach ($this as $item) {
         $storeview = $item->getStoreView();
         // chuoi storeview
         $store = explode(",", $storeview);
         // 1,2 => array(1,2)
         $item->setData('store_view', $store);
     }
     parent::_afterLoad();
 }
Пример #30
0
 protected function _afterLoad()
 {
     parent::_afterLoad();
     if ($storeId = $this->getStoreId()) {
         //die('111111111111');
         foreach ($this->_items as $item) {
             $item->setStoreId($storeId)->loadProductFileValue();
         }
     }
     return $this;
 }