本文整理汇总了PHP中Mage_Core_Model_Resource_Db_Abstract::_afterLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Resource_Db_Abstract::_afterLoad方法的具体用法?PHP Mage_Core_Model_Resource_Db_Abstract::_afterLoad怎么用?PHP Mage_Core_Model_Resource_Db_Abstract::_afterLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Resource_Db_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Resource_Db_Abstract::_afterLoad方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
/**
* Perform actions after object load
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if ($object->getChanges() && !is_array($object->getChanges())) {
$object->setChanges(Zend_Json::decode($object->getChanges()));
}
return parent::_afterLoad($object);
}
示例2: _afterLoad
/**
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if ($object->getData('additional')) {
$object->setData('additional', Mage::helper('core')->jsonDecode($object->getData('additional')));
}
return parent::_afterLoad($object);
}
示例3: _afterLoad
/**
* Perform actions after object load
*
* @param Varien_Object $object
* @return Enterprise_Reward_Model_Resource_Reward_History
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
parent::_afterLoad($object);
if (is_string($object->getData('additional_data'))) {
$object->setData('additional_data', unserialize($object->getData('additional_data')));
}
return $this;
}
示例4: _afterLoad
/**
* Perform operations after object load
*
* @access public
* @param Mage_Core_Model_Abstract $object
* @return Ibrams_CmsExtended_Model_Resource_Cmspage
* @author Ultimate Module Creator
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if ($object->getId()) {
$stores = $this->lookupStoreIds($object->getId());
$object->setData('store_id', $stores);
}
return parent::_afterLoad($object);
}
示例5: _afterLoad
/**
* Perform actions after object load
*
* @param Mage_Widget_Model_Widget_Instance $object
* @return Mage_Widget_Model_Resource_Widget_Instance
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getTable('widget/widget_instance_page'))->where('instance_id = ?', (int) $object->getId());
$result = $adapter->fetchAll($select);
$object->setData('page_groups', $result);
return parent::_afterLoad($object);
}
示例6: _afterLoad
/**
* @param Webguys_Easytemplate_Model_Template $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
// TODO: Solve this workaround
if ($object->getValidFrom()) {
$object->setValidFrom(date('Y-m-d', strtotime($object->getValidFrom())));
}
if ($object->getValidTo()) {
$object->setValidTo(date('Y-m-d', strtotime($object->getValidTo())));
}
return parent::_afterLoad($object);
}
示例7: _afterLoad
/**
* Unserialize system report data
*
* @param Mage_Core_Model_Abstract $object
*
* @return Enterprise_Support_Model_Resource_Sysreport
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
try {
$data = unserialize($object->getReportData());
} catch (Exception $e) {
Mage::throwException(Mage::helper('enterprise_support')->__('There was an error while loading system report data.'));
$data = array();
}
$object->setReportData($data);
parent::_afterLoad($object);
return $this;
}
示例8: _afterLoad
/**
* @param Mage_Core_Model_Abstract $object
*
* @return $this|Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$select = $this->_getReadAdapter()->select()->from($this->getTable('store'))->where('slideshow_id = ?', $object->getId());
if ($data = $this->_getReadAdapter()->fetchAll($select)) {
$storesArray = array();
foreach ($data as $row) {
$storesArray[] = $row['store_id'];
}
$object->setData('store_id', $storesArray);
}
return parent::_afterLoad($object);
}
示例9: _afterLoad
/**
* Actions after load
*
* @param Mage_Rating_Model_Rating $object
* @return Mage_Rating_Model_Resource_Rating
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
parent::_afterLoad($object);
if (!$object->getId()) {
return $this;
}
$adapter = $this->_getReadAdapter();
$bind = array(':rating_id' => (int) $object->getId());
// load rating titles
$select = $adapter->select()->from($this->getTable('rating/rating_title'), array('store_id', 'value'))->where('rating_id=:rating_id');
$result = $adapter->fetchPairs($select, $bind);
if ($result) {
$object->setRatingCodes($result);
}
// load rating available in stores
$object->setStores($this->getStores((int) $object->getId()));
return $this;
}
示例10: _afterLoad
/**
* Add store data to wrapping data
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->_storeAttributesTable, array('scope' => $adapter->getCheckSql('store_id = 0', $adapter->quote('default'), $adapter->quote('store')), 'design'))->where('wrapping_id = ?', $object->getId())->where('store_id IN (0,?)', $object->getStoreId());
$data = $adapter->fetchAssoc($select);
if (isset($data['store']) && is_array($data['store'])) {
foreach ($data['store'] as $key => $value) {
$object->setData($key, $value !== null ? $value : $data['default'][$key]);
$object->setData($key . '_store', $value);
}
} else {
if (isset($data['default'])) {
foreach ($data['default'] as $key => $value) {
$object->setData($key, $value);
}
}
}
return parent::_afterLoad($object);
}
示例11: _afterLoad
/**
* Add store date to registry type data
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$adapter = $this->_getReadAdapter();
$scopeCheckExpr = $adapter->getCheckSql('store_id = 0', $adapter->quote('default'), $adapter->quote('store'));
$storeIds = array(Mage_Core_Model_App::ADMIN_STORE_ID);
if ($object->getStoreId()) {
$storeIds[] = (int) $object->getStoreId();
}
$select = $adapter->select()->from($this->_infoTable, array('scope' => $scopeCheckExpr, 'label', 'is_listed', 'sort_order'))->where('type_id = ?', (int) $object->getId())->where('store_id IN (?)', $storeIds);
$data = $adapter->fetchAssoc($select);
if (isset($data['store']) && is_array($data['store'])) {
foreach ($data['store'] as $key => $value) {
$object->setData($key, $value !== null ? $value : $data['default'][$key]);
$object->setData($key . '_store', $value);
}
} elseif (isset($data['default']) && is_array($data['default'])) {
foreach ($data['default'] as $key => $value) {
$object->setData($key, $value);
}
}
return parent::_afterLoad($object);
}
示例12: _afterLoad
/**
* Perform actions after object is loaded
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
if ($object->getId()) {
$object->setTypeById($object->getData('type_id'));
$object->setCustomValues(unserialize($object->getCustomValues()));
}
return parent::_afterLoad($object);
}
示例13: _afterLoad
/**
* Perform actions after object load
*
* @param Varien_Object $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
parent::_afterLoad($object);
// Add information about quote to visitor
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getTable('log/quote_table'), 'quote_id')->where('visitor_id = ?', $object->getId())->order('quote_id DESC')->limit(1);
$result = $adapter->query($select)->fetch();
if (isset($result['quote_id'])) {
$object->setQuoteId((int) $result['quote_id']);
}
return $this;
}
示例14: _afterLoad
/**
* Method to run after load
*
* @param Mage_Core_Model_Abstract $object
* @return Mage_Core_Model_Resource_Db_Abstract
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
$select = $this->_getReadAdapter()->select()->from($this->getTable('checkout/agreement_store'), array('store_id'))->where('agreement_id = :agreement_id');
if ($stores = $this->_getReadAdapter()->fetchCol($select, array(':agreement_id' => $object->getId()))) {
$object->setData('store_id', $stores);
}
return parent::_afterLoad($object);
}
示例15: _afterLoad
/**
* Perform operations after object load
*
* @access public
* @param Mage_Core_Model_Abstract $object
* @return DB1_AnyMarket_Model_Resource_Anymarketimage
*
*/
protected function _afterLoad(Mage_Core_Model_Abstract $object)
{
return parent::_afterLoad($object);
}