本文整理汇总了PHP中Magento\Catalog\Model\Resource\Product\Collection::_initSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::_initSelect方法的具体用法?PHP Collection::_initSelect怎么用?PHP Collection::_initSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Catalog\Model\Resource\Product\Collection
的用法示例。
在下文中一共展示了Collection::_initSelect方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initSelect
/**
* Add attributes to select
*
* @return $this
*/
public function _initSelect()
{
parent::_initSelect();
$allowedProductTypes = $this->_productTypeConfig->getComposableTypes();
$this->addAttributeToSelect('name')->addAttributeToSelect('price')->addAttributeToSelect('sku')->addAttributeToSelect('weight')->addAttributeToSelect('image')->addFieldToFilter('type_id', $allowedProductTypes)->addFieldToFilter('entity_id', array('neq' => $this->getProduct()->getId()))->addFilterByRequiredOptions()->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner')->joinTable(array('cisi' => 'cataloginventory_stock_item'), 'product_id=entity_id', array('qty' => 'qty', 'inventory_in_stock' => 'is_in_stock'), null, 'left');
return $this;
}
示例2: _initSelect
/**
* Initialize select
*
* @return $this
*/
protected function _initSelect()
{
parent::_initSelect();
$this->_joinFields();
return $this;
}
示例3: _initSelect
/**
* Initialize collection select
*
* @return $this|void
*/
protected function _initSelect()
{
parent::_initSelect();
$this->getSelect()->join(array('selection' => $this->_selectionTable), 'selection.product_id = e.entity_id', array('*'));
}
示例4: _initSelect
/**
* Init select
* @return $this|\Magento\ConfigurableProduct\Model\Resource\Product\Type\Configurable\Product\Collection
*/
protected function _initSelect()
{
parent::_initSelect();
$this->getSelect()->join(['link_table' => $this->_linkTable], 'link_table.product_id = e.entity_id', ['parent_id']);
return $this;
}
示例5: _initSelect
/**
* Init Select
*
* @return \Magento\Catalog\Model\Resource\Product\Collection
*/
protected function _initSelect()
{
parent::_initSelect();
$this->_joinReview();
return $this;
}
示例6: _initSelect
/**
* Initialize collection select
*
* @return $this|void
*/
protected function _initSelect()
{
parent::_initSelect();
$this->getSelect()->join(['selection' => $this->_selectionTable], 'selection.product_id = e.entity_id', ['*']);
}