本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}