當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。