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


PHP Criteria::addJoinObject方法代码示例

本文整理汇总了PHP中Propel\Runtime\ActiveQuery\Criteria::addJoinObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::addJoinObject方法的具体用法?PHP Criteria::addJoinObject怎么用?PHP Criteria::addJoinObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Propel\Runtime\ActiveQuery\Criteria的用法示例。


在下文中一共展示了Criteria::addJoinObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addJoinProduct

 /**
  * Join products and their URLs
  *
  * @param Criteria $query
  */
 protected function addJoinProduct(Criteria &$query)
 {
     // Join RewritingURL with Product to have only visible products
     $join = new Join();
     $join->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'VIEW_ID', null, ProductTableMap::TABLE_NAME, 'ID', null);
     $join->setJoinType(Criteria::INNER_JOIN);
     $query->addJoinObject($join, 'productJoin');
     // Get only visible products
     $query->addJoinCondition('productJoin', ProductTableMap::VISIBLE, 1, Criteria::EQUAL, \PDO::PARAM_INT);
 }
开发者ID:thelia-modules,项目名称:Sitemap,代码行数:15,代码来源:ProductSitemapTrait.php

示例2: addJoinProductI18n

 /**
  * Join products and their URLs
  *
  * @param Criteria $query
  */
 protected function addJoinProductI18n(Criteria &$query)
 {
     // Join RewritingURL with Product to have only visible products
     $join = new Join();
     $join->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'VIEW_ID', null, ProductTableMap::TABLE_NAME, 'ID', null);
     $join->setJoinType(Criteria::INNER_JOIN);
     $query->addJoinObject($join, 'productJoin');
     $query->addJoinCondition('productJoin', ProductTableMap::VISIBLE, 1, Criteria::EQUAL, \PDO::PARAM_INT);
     // Join RewritingURL with ProductI18n to have product title for it's image
     $joinI18n = new Join();
     $joinI18n->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'VIEW_ID', null, ProductI18nTableMap::TABLE_NAME, 'ID', null);
     $joinI18n->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'VIEW_LOCALE', null, ProductI18nTableMap::TABLE_NAME, 'LOCALE', null);
     $joinI18n->setJoinType(Criteria::INNER_JOIN);
     $query->addJoinObject($joinI18n);
     // Join RewritingURL with ProductImage to have image file
     $joinImage = new Join();
     $joinImage->addExplicitCondition(RewritingUrlTableMap::TABLE_NAME, 'VIEW_ID', null, ProductImageTableMap::TABLE_NAME, 'PRODUCT_ID', null);
     $joinImage->setJoinType(Criteria::INNER_JOIN);
     $query->addJoinObject($joinImage, 'productImageJoin');
     $query->addJoinCondition('productImageJoin', ProductImageTableMap::VISIBLE, 1, Criteria::EQUAL, \PDO::PARAM_INT);
 }
开发者ID:thelia-modules,项目名称:Sitemap,代码行数:26,代码来源:ProductImageTrait.php


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