本文整理汇总了PHP中Magento\Framework\Model\Resource\Db\AbstractDb::_afterLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractDb::_afterLoad方法的具体用法?PHP AbstractDb::_afterLoad怎么用?PHP AbstractDb::_afterLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\Resource\Db\AbstractDb
的用法示例。
在下文中一共展示了AbstractDb::_afterLoad方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
/**
* Perform actions after object load
*
* @param \Magento\Widget\Model\Widget\Instance $object
* @return $this
*/
protected function _afterLoad(AbstractModel $object)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getTable('widget_instance_page'))->where('instance_id = ?', (int) $object->getId());
$result = $adapter->fetchAll($select);
$object->setData('page_groups', $result);
return parent::_afterLoad($object);
}
示例2: _afterLoad
/**
* After translation loading
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
public function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getMainTable(), array('store_id', 'translate'))->where('string = :translate_string');
$translations = $adapter->fetchPairs($select, array('translate_string' => $object->getString()));
$object->setStoreTranslations($translations);
return parent::_afterLoad($object);
}
示例3: _afterLoad
/**
* @inheritdoc
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
$this->entitySnapshot->registerSnapshot($object);
return parent::_afterLoad($object);
}
示例4: _afterLoad
/**
* Actions after load
*
* @param \Magento\Framework\Model\AbstractModel|\Magento\Review\Model\Rating $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $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_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;
}
示例5: _afterLoad
/**
* Perform operations after object load
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$stores = $this->lookupStoreIds($object->getId());
$object->setData('store_id', $stores);
}
return parent::_afterLoad($object);
}
示例6: _afterLoad
/**
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterLoad($object);
$this->loadLabel($object);
$this->loadPrices($object);
return $this;
}
示例7: _afterLoad
/**
* Unserialize user extra data after user load
*
* @param \Magento\Framework\Model\AbstractModel $user
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $user)
{
if (is_string($user->getExtra())) {
$user->setExtra(unserialize($user->getExtra()));
}
return parent::_afterLoad($user);
}
示例8: _afterLoad
/**
* Perform actions after object load
*
* @param \Magento\Framework\Model\AbstractModel|\Magento\Framework\Object $object
* @return \Magento\Framework\Model\Resource\Db\AbstractDb
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterLoad($object);
// Add information about quote to visitor
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getTable('log_quote'), 'quote_id')->where('visitor_id = ?', $object->getId())->limit(1);
$result = $adapter->query($select)->fetch();
if (isset($result['quote_id'])) {
$object->setQuoteId((int) $result['quote_id']);
}
return $this;
}
示例9: _afterLoad
/**
* Method to run after load
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $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);
}