本文整理汇总了PHP中Doctrine\ORM\QueryBuilder::innerJoinInventory方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryBuilder::innerJoinInventory方法的具体用法?PHP QueryBuilder::innerJoinInventory怎么用?PHP QueryBuilder::innerJoinInventory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder::innerJoinInventory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareCndOrderBy
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param array $value Condition data
* @param boolean $countOnly "Count only" flag. Do not need to add "order by"
* clauses if only count is needed.
*
* @return void
*/
protected function prepareCndOrderBy(\Doctrine\ORM\QueryBuilder $queryBuilder, array $value, $countOnly)
{
if (!$countOnly) {
list($sort, $order) = $this->getSortOrderValue($value);
// FIXME - add aliases for sort modes
if ('i.amount' === $sort) {
$queryBuilder->innerJoinInventory();
} elseif ('p.price' == $sort && !\XLite::isAdminZone()) {
$this->assignCalculatedField($queryBuilder, 'price');
$sort = 'calculatedPrice';
} elseif ('translations.name' == $sort && !$countOnly) {
$this->addSortByTranslation($queryBuilder, $sort, $order);
$sort = 'calculatedName';
}
$queryBuilder->addOrderBy($sort, $order);
}
}
示例2: prepareCndInStock
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param string $value Condition data
*
* @return void
*/
protected function prepareCndInStock(\Doctrine\ORM\QueryBuilder $queryBuilder, $value)
{
if ($value) {
$queryBuilder->innerJoinInventory()->andWhere('i.amount > :zero OR i.enabled = 0')->setParameter('zero', 0)->andWhere('p.arrivalDate < :now')->setParameter('now', \XLite\Core\Converter::getDayEnd(\XLite\Base\SuperClass::getUserTime()));
}
}