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


PHP AbstractDb::_getLoadSelect方法代码示例

本文整理汇总了PHP中Magento\Framework\Model\Resource\Db\AbstractDb::_getLoadSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractDb::_getLoadSelect方法的具体用法?PHP AbstractDb::_getLoadSelect怎么用?PHP AbstractDb::_getLoadSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\Model\Resource\Db\AbstractDb的用法示例。


在下文中一共展示了AbstractDb::_getLoadSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getLoadSelect

 /**
  * Prepare wishlist load select query
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     if ($field == $this->_customerIdFieldName) {
         $select->order('wishlist_id ' . \Zend_Db_Select::SQL_ASC)->limit(1);
     }
     return $select;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:Wishlist.php

示例2: _getLoadSelect

 /**
  * Add expiration date filter to select
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Persistent\Model\Session $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     if (!$object->getLoadExpired()) {
         $tableName = $this->getMainTable();
         $select->join(['customer' => $this->getTable('customer_entity')], 'customer.entity_id = ' . $tableName . '.customer_id')->where($tableName . '.updated_at >= ?', $object->getExpiredBefore());
     }
     return $select;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Session.php

示例3: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     if ($field == 'default_state') {
         $select = $this->_getReadAdapter()->select()->from($this->getMainTable(), ['label'])->join(['state_table' => $this->stateTable], $this->getMainTable() . '.status = state_table.status', 'status')->where('state_table.state = ?', $value)->order('state_table.is_default DESC')->limit(1);
     } else {
         $select = parent::_getLoadSelect($field, $value, $object);
     }
     return $select;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Status.php

示例4: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Log\Model\Customer $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     if ($field == 'customer_id') {
         // load additional data by last login
         $table = $this->getMainTable();
         $select->joinInner(['lvt' => $this->_visitorTable], "lvt.visitor_id = {$table}.visitor_id", ['last_visit_at'])->joinInner(['lvit' => $this->_visitorInfoTable], 'lvt.visitor_id = lvit.visitor_id', ['http_referer', 'remote_addr'])->joinInner(['luit' => $this->_urlInfoTable], 'luit.url_id = lvt.last_url_id', ['url'])->order("{$table}.login_at DESC")->limit(1);
     }
     return $select;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:18,代码来源:Customer.php

示例5: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Review\Model\Rating $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $adapter = $this->_getReadAdapter();
     $table = $this->getMainTable();
     $storeId = (int) $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId();
     $select = parent::_getLoadSelect($field, $value, $object);
     $codeExpr = $adapter->getIfNullSql('title.value', "{$table}.rating_code");
     $select->joinLeft(['title' => $this->getTable('rating_title')], $adapter->quoteInto("{$table}.rating_id = title.rating_id AND title.store_id = ?", $storeId), ['rating_code' => $codeExpr]);
     return $select;
 }
开发者ID:nja78,项目名称:magento2,代码行数:18,代码来源:Rating.php

示例6: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\UrlRewrite\Model\UrlRewrite $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     /** @var $select \Magento\Framework\DB\Select */
     $select = parent::_getLoadSelect($field, $value, $object);
     if ($object->getStoreId() !== null) {
         $select->where('store_id IN(?)', [\Magento\Store\Model\Store::DEFAULT_STORE_ID, $object->getStoreId()]);
         $select->order('store_id ' . \Magento\Framework\DB\Select::SQL_DESC);
         $select->limit(1);
     }
     return $select;
 }
开发者ID:vasiljok,项目名称:magento2,代码行数:19,代码来源:UrlRewrite.php

示例7: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $adapter = $this->_getReadAdapter();
     $locale = $this->_localeResolver->getLocaleCode();
     $systemLocale = \Magento\Framework\AppInterface::DISTRO_LOCALE_CODE;
     $regionField = $adapter->quoteIdentifier($this->getMainTable() . '.' . $this->getIdFieldName());
     $condition = $adapter->quoteInto('lrn.locale = ?', $locale);
     $select->joinLeft(array('lrn' => $this->_regionNameTable), "{$regionField} = lrn.region_id AND {$condition}", array());
     if ($locale != $systemLocale) {
         $nameExpr = $adapter->getCheckSql('lrn.region_id is null', 'srn.name', 'lrn.name');
         $condition = $adapter->quoteInto('srn.locale = ?', $systemLocale);
         $select->joinLeft(array('srn' => $this->_regionNameTable), "{$regionField} = srn.region_id AND {$condition}", array('name' => $nameExpr));
     } else {
         $select->columns(array('name'), 'lrn');
     }
     return $select;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:26,代码来源:Region.php

示例8: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return $this
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     return $select;
 }
开发者ID:defyasdf,项目名称:magento2-module-webhook,代码行数:13,代码来源:Webhook.php

示例9: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Cms\Model\Page $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     if ($object->getStoreId()) {
         $storeIds = array(\Magento\Store\Model\Store::DEFAULT_STORE_ID, (int) $object->getStoreId());
         $select->join(array('cms_page_store' => $this->getTable('cms_page_store')), $this->getMainTable() . '.page_id = cms_page_store.page_id', array())->where('is_active = ?', 1)->where('cms_page_store.store_id IN (?)', $storeIds)->order('cms_page_store.store_id DESC')->limit(1);
     }
     return $select;
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:17,代码来源:Page.php

示例10: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param AbstractModel $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $select->where('store_id = ?', (int) $object->getStoreId());
     return $select;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:14,代码来源:Summary.php

示例11: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Ashsmith\Blog\Model\Post $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $select->where('is_active = ?', 1)->limit(1);
     return $select;
 }
开发者ID:andrew-smart,项目名称:magento2-blog-module-tutorial,代码行数:14,代码来源:Post.php

示例12: loadByIdWithoutStore

 /**
  * Load quote data by identifier without store
  *
  * @param \Magento\Quote\Model\Quote $quote
  * @param int $quoteId
  * @return $this
  */
 public function loadByIdWithoutStore($quote, $quoteId)
 {
     $read = $this->_getReadAdapter();
     if ($read) {
         $select = parent::_getLoadSelect('entity_id', $quoteId, $quote);
         $data = $read->fetchRow($select);
         if ($data) {
             $quote->setData($data);
         }
     }
     $this->_afterLoad($quote);
     return $this;
 }
开发者ID:kid17,项目名称:magento2,代码行数:20,代码来源:Quote.php

示例13: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param FormFieldset $object
  * @return Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $labelExpr = $select->getAdapter()->getIfNullSql('store_label.label', 'default_label.label');
     $select->joinLeft(['default_label' => $this->getTable('eav_form_fieldset_label')], $this->getMainTable() . '.fieldset_id = default_label.fieldset_id AND default_label.store_id=0', [])->joinLeft(['store_label' => $this->getTable('eav_form_fieldset_label')], $this->getMainTable() . '.fieldset_id = store_label.fieldset_id AND default_label.store_id=' . (int) $object->getStoreId(), ['label' => $labelExpr]);
     return $select;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:15,代码来源:Fieldset.php

示例14: _getLoadSelect

 /**
  * Get load select
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     if ($object->getStoreId()) {
         $select->join(array('cps' => $this->getTable('checkout_agreement_store')), $this->getMainTable() . '.agreement_id = cps.agreement_id')->where('is_active=1')->where('cps.store_id IN (0, ?)', $object->getStoreId())->order('store_id DESC')->limit(1);
     }
     return $select;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:16,代码来源:Agreement.php

示例15: _getLoadSelect

 /**
  * Retrieve select object and join it to product entity table to get type ids
  *
  * @param string $field
  * @param int $value
  * @param \Magento\CatalogInventory\Model\Stock\Item $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object)->join(['p' => $this->getTable('catalog_product_entity')], 'product_id=p.entity_id', ['type_id']);
     return $select;
 }
开发者ID:niranjanssiet,项目名称:magento2,代码行数:13,代码来源:Item.php


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