本文整理汇总了PHP中Magento\Framework\Model\ResourceModel\Db\AbstractDb::_afterLoad方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractDb::_afterLoad方法的具体用法?PHP AbstractDb::_afterLoad怎么用?PHP AbstractDb::_afterLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Model\ResourceModel\Db\AbstractDb
的用法示例。
在下文中一共展示了AbstractDb::_afterLoad方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _afterLoad
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterLoad($object);
$connection = $this->getConnection();
$select = $connection->select()->from($this->getTable('shipperhq_quote_package_items'));
$select->where('package_id=?', $object->getId());
$items = $connection->fetchAll($select);
if ($items) {
$object->setData('items', $items);
}
return $this;
}
示例2: _afterLoad
/**
* Perform actions after object load
*
* @param \Magento\Widget\Model\Widget\Instance $object
* @return $this
*/
protected function _afterLoad(AbstractModel $object)
{
$connection = $this->getConnection();
$select = $connection->select()->from($this->getTable('widget_instance_page'))->where('instance_id = ?', (int) $object->getId());
$result = $connection->fetchAll($select);
$object->setData('page_groups', $result);
return parent::_afterLoad($object);
}
示例3: _afterLoad
/**
* {@inheritdoc}
*/
protected function _afterLoad(AbstractModel $object)
{
$properties = unserialize($object->getData('properties_serialized'));
if (is_array($properties)) {
$object->setData('properties', $properties);
}
return parent::_afterLoad($object);
}
示例4: _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()) {
$productIds = $this->lookupProductIds($object->getId());
$productId = implode(',', $productIds);
$object->setData('product_id', $productId);
}
return parent::_afterLoad($object);
}
示例5: _afterLoad
/**
* Perform operations after object load, restore linking with terms and stores
*
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
*
* @param \Magento\Framework\Model\AbstractModel $object Thesaurus being loaded
*
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
if ($object->getId()) {
$stores = $this->getStoreIdsFromThesaurusId($object->getId());
$object->setData('store_id', $stores);
$object->setData('stores', $stores);
}
return parent::_afterLoad($object);
}
示例6: _afterLoad
/**
* Perform operations after object load
*
* @param AbstractModel $object
* @return $this
*/
protected function _afterLoad(AbstractModel $object)
{
if ($object->getId()) {
$stores = $this->lookupStoreIds($object->getId());
$object->setData('store_id', $stores);
}
return parent::_afterLoad($object);
}
示例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 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);
$categories = $this->lookupCategoryIds($object->getId());
$object->setCategories($categories);
$relatedPosts = $this->lookupRelatedPostIds($object->getId());
$object->setRelatedPostIds($relatedPosts);
$relatedProducts = $this->lookupRelatedProductIds($object->getId());
$object->setRelatedProductIds($relatedProducts);
}
return parent::_afterLoad($object);
}
示例9: _afterLoad
/**
* After translation loading
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
public function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
$connection = $this->getConnection();
$select = $connection->select()->from(
$this->getMainTable(),
['store_id', 'translate']
)->where(
'string = :translate_string'
);
$translations = $connection->fetchPairs($select, ['translate_string' => $object->getString()]);
$object->setStoreTranslations($translations);
return parent::_afterLoad($object);
}
示例10: _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()) {
$storeIds = $this->lookupStoreIds($object->getId());
$object->setData('store_ids', $storeIds);
$categories = $this->lookupCategoryIds($object->getId());
$object->setCategories($categories);
$tags = $this->lookupTagIds($object->getId());
$object->setTags($tags);
}
return parent::_afterLoad($object);
}
示例11: _afterLoad
/**
* Method to run after load
*
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
$select = $this->getConnection()->select()->from($this->getTable('checkout_agreement_store'), ['store_id'])->where('agreement_id = :agreement_id');
$stores = $this->getConnection()->fetchCol($select, [':agreement_id' => $object->getId()]);
if ($stores) {
$object->setData('stores', $stores);
}
return parent::_afterLoad($object);
}
示例12: _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;
}
$connection = $this->getConnection();
$bind = [':rating_id' => (int) $object->getId()];
// load rating titles
$select = $connection->select()->from($this->getTable('rating_title'), ['store_id', 'value'])->where('rating_id=:rating_id');
$result = $connection->fetchPairs($select, $bind);
if ($result) {
$object->setRatingCodes($result);
}
// load rating available in stores
$object->setStores($this->getStores((int) $object->getId()));
return $this;
}
示例13: _afterLoad
/**
* @param \Magento\Framework\Model\AbstractModel $object
* @return $this
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
parent::_afterLoad($object);
$this->loadLabel($object);
return $this;
}
示例14: _afterLoad
/**
* @inheritdoc
*/
protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
{
$this->entitySnapshot->registerSnapshot($object);
return parent::_afterLoad($object);
}