当前位置: 首页>>代码示例>>PHP>>正文


PHP AbstractDb::_afterLoad方法代码示例

本文整理汇总了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;
 }
开发者ID:shipperhq,项目名称:module-shipper,代码行数:12,代码来源:Packages.php

示例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);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:Instance.php

示例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);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:11,代码来源:Index.php

示例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);
 }
开发者ID:vladankuzmanovic,项目名称:ProductFaq,代码行数:15,代码来源:Question.php

示例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);
 }
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:18,代码来源:Thesaurus.php

示例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);
 }
开发者ID:sz-bill,项目名称:Magento2.x,代码行数:14,代码来源:Author.php

示例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);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:User.php

示例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);
 }
开发者ID:samitrimal,项目名称:Blog-Extension-for-Magento-2,代码行数:20,代码来源:Post.php

示例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);
 }
开发者ID:razbakov,项目名称:magento2,代码行数:19,代码来源:StringUtils.php

示例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);
 }
开发者ID:magefan,项目名称:module-blog,代码行数:18,代码来源:Post.php

示例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);
 }
开发者ID:hientruong90,项目名称:magento2_installer,代码行数:15,代码来源:Agreement.php

示例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;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:24,代码来源:Rating.php

示例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;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Attribute.php

示例14: _afterLoad

 /**
  * @inheritdoc
  */
 protected function _afterLoad(\Magento\Framework\Model\AbstractModel $object)
 {
     $this->entitySnapshot->registerSnapshot($object);
     return parent::_afterLoad($object);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:8,代码来源:AbstractDb.php


注:本文中的Magento\Framework\Model\ResourceModel\Db\AbstractDb::_afterLoad方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。