本文整理汇总了PHP中Zend_Db_Select::useStraightJoin方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Select::useStraightJoin方法的具体用法?PHP Zend_Db_Select::useStraightJoin怎么用?PHP Zend_Db_Select::useStraightJoin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Db_Select
的用法示例。
在下文中一共展示了Zend_Db_Select::useStraightJoin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addIsVisibleInStoreFilter
/**
* Filter the select to append only product visible into the catalog or search into the index.
*
* Note : Magento put only enabled products that have the following
* visibility into the catalog_category_product_index table :
* - visible in catalog
* - visible in search
* - visible in catalog & search
*
* So joining on the root category will filter only products that have to be indexed
* and you don't need to put any additional filter on the visibility field.
*
* @param \Zend_Db_Select $select Product select to be filtered.
* @param integer $storeId Store Id
*
* @return \Smile\ElasticsuiteCatalog\Model\ResourceModel\Product\Indexer\Fulltext\Action\Full Self Reference
*/
private function addIsVisibleInStoreFilter($select, $storeId)
{
$rootCategoryId = $this->getRootCategoryId($storeId);
$indexTable = $this->getTable('catalog_category_product_index');
$visibilityJoinCond = $this->getConnection()->quoteInto('visibility.product_id = e.entity_id AND visibility.store_id = ?', $storeId);
$select->useStraightJoin(true)->join(['visibility' => $indexTable], $visibilityJoinCond, ['visibility'])->where('visibility.category_id = ?', (int) $rootCategoryId);
return $this;
}