當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AbstractDb::_getLoadSelect方法代碼示例

本文整理匯總了PHP中Magento\Framework\Model\ResourceModel\Db\AbstractDb::_getLoadSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractDb::_getLoadSelect方法的具體用法?PHP AbstractDb::_getLoadSelect怎麽用?PHP AbstractDb::_getLoadSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\Model\ResourceModel\Db\AbstractDb的用法示例。


在下文中一共展示了AbstractDb::_getLoadSelect方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _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);
     if ($object->getStoreId()) {
         $select->where('is_active = ?', 1)->limit(1);
     }
     return $select;
 }
開發者ID:luxwan13,項目名稱:magento2-learning,代碼行數:16,代碼來源:Post.php

示例2: _getLoadByMethodIDSelect

 /**
  * Retrieve load select with filter by url_key and activity
  *
  * @param string $url_key
  * @param int $isActive
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadByMethodIDSelect($method_id, $isActive = null)
 {
     $select = parent::_getLoadSelect('method_id', $method_id, null);
     if (!is_null($isActive)) {
         $select->where('active = ?', !empty($isActive) ? 1 : 0);
     }
     return $select;
 }
開發者ID:smart2pay,項目名稱:magento20,代碼行數:15,代碼來源:Method.php

示例3: _getLoadSelect

 /**
  * Prepare wishlist load select query
  *
  * @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 ($field == $this->_customerIdFieldName) {
         $select->order('wishlist_id ' . \Magento\Framework\DB\Select::SQL_ASC)->limit(1);
     }
     return $select;
 }
開發者ID:IlyaGluschenko,項目名稱:test001,代碼行數:16,代碼來源:Wishlist.php

示例4: _getLoadSelect

 /**
  * Add expiration date filter to select
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Persistent\Model\Session $object
  * @return \Magento\Framework\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:pradeep-wagento,項目名稱:magento2,代碼行數:17,代碼來源:Session.php

示例5: _getLoadByCountryIDSelect

 /**
  * Retrieve load select with filter by country_id
  *
  * @param string $url_key
  * @param null|\Magento\Framework\DB\Select $select
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadByCountryIDSelect($country_id, $select = null)
 {
     if (empty($select)) {
         $select = parent::_getLoadSelect('country_id', $country_id, null);
     } else {
         $select->where('country_id = ?', $country_id);
     }
     return $select;
 }
開發者ID:smart2pay,項目名稱:magento20,代碼行數:16,代碼來源:ConfiguredMethods.php

示例6: _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)
 {
     $connection = $this->getConnection();
     $table = $this->getMainTable();
     $storeId = (int) $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId();
     $select = parent::_getLoadSelect($field, $value, $object);
     $codeExpr = $connection->getIfNullSql('title.value', "{$table}.rating_code");
     $select->joinLeft(['title' => $this->getTable('rating_title')], $connection->quoteInto("{$table}.rating_id = title.rating_id AND title.store_id = ?", $storeId), ['rating_code' => $codeExpr]);
     return $select;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:18,代碼來源:Rating.php

示例7: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\UrlRewrite\Model\UrlRewrite $object
  * @return \Magento\Framework\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:kidaa30,項目名稱:magento2-platformsh,代碼行數:19,代碼來源:UrlRewrite.php

示例8: _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);
     $connection = $this->getConnection();
     $locale = $this->_localeResolver->getLocale();
     $systemLocale = \Magento\Framework\AppInterface::DISTRO_LOCALE_CODE;
     $regionField = $connection->quoteIdentifier($this->getMainTable() . '.' . $this->getIdFieldName());
     $condition = $connection->quoteInto('lrn.locale = ?', $locale);
     $select->joinLeft(['lrn' => $this->_regionNameTable], "{$regionField} = lrn.region_id AND {$condition}", []);
     if ($locale != $systemLocale) {
         $nameExpr = $connection->getCheckSql('lrn.region_id is null', 'srn.name', 'lrn.name');
         $condition = $connection->quoteInto('srn.locale = ?', $systemLocale);
         $select->joinLeft(['srn' => $this->_regionNameTable], "{$regionField} = srn.region_id AND {$condition}", ['name' => $nameExpr]);
     } else {
         $select->columns(['name'], 'lrn');
     }
     return $select;
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:26,代碼來源:Region.php

示例9: _getLoadSelect

 /**
  * Default select items not yet exported
  *
  * @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);
     $select->where('is_exported = ?', 0)->limit(1);
     return $select;
 }
開發者ID:richdynamix,項目名稱:personalised-products,代碼行數:14,代碼來源:Export.php

示例10: _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);
     return $select;
 }
開發者ID:mrbadao,項目名稱:magento-ce,代碼行數:13,代碼來源:Store.php

示例11: _getLoadByCodeSelect

 /**
  * Retrieve load select with filter by country code
  *
  * @param string $code
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadByCodeSelect($code)
 {
     $select = parent::_getLoadSelect('code', $code, null);
     return $select;
 }
開發者ID:smart2pay,項目名稱:magento20,代碼行數:11,代碼來源:Country.php

示例12: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Msd\Statistics\Model\Statistics\ $object
  * @return \Zend_Db_Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $select->where('active = ?', 1);
     return $select;
 }
開發者ID:magestackday,項目名稱:msd-statistics,代碼行數:14,代碼來源:Statistics.php

示例13: _getLoadSelect

 /**
  * Retrieve select for load
  *
  * @param String $field
  * @param String $value
  * @param \Magento\Framework\Model\AbstractModel $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $select->where('store_id = ?', \Magento\Store\Model\Store::DEFAULT_STORE_ID);
     return $select;
 }
開發者ID:razbakov,項目名稱:magento2,代碼行數:14,代碼來源:StringUtils.php

示例14: _getLoadSelect

 /**
  * Retrieve select object for load object data
  *
  * @param string $field
  * @param mixed $value
  * @param \Magento\Eav\Model\Form\Element $object
  * @return \Magento\Framework\DB\Select
  */
 protected function _getLoadSelect($field, $value, $object)
 {
     $select = parent::_getLoadSelect($field, $value, $object);
     $select->join($this->getTable('eav_attribute'), $this->getTable('eav_attribute') . '.attribute_id = ' . $this->getMainTable() . '.attribute_id', ['attribute_code', 'entity_type_id']);
     return $select;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:Element.php

示例15: _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);
     $this->_addValueToSelect($select, $object->getStoreId());
     return $select;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:14,代碼來源:Variable.php


注:本文中的Magento\Framework\Model\ResourceModel\Db\AbstractDb::_getLoadSelect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。