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