当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Db_Select::useStraightJoin方法代码示例

本文整理汇总了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;
 }
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:25,代码来源:Full.php


注:本文中的Zend_Db_Select::useStraightJoin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。