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


PHP AbstractDb::_afterLoad方法代码示例

本文整理汇总了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);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:Instance.php

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

示例3: _afterLoad

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

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

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

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

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

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


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