本文整理汇总了PHP中Doctrine\ORM\QueryBuilder::linkInner方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryBuilder::linkInner方法的具体用法?PHP QueryBuilder::linkInner怎么用?PHP QueryBuilder::linkInner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder::linkInner方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareCndCategoryId
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param mixed $value Condition data
*
* @return void
*/
protected function prepareCndCategoryId(\Doctrine\ORM\QueryBuilder $queryBuilder, $value)
{
if (is_object($value) && $value instanceof \XLite\Model\Category) {
$value = $value->getCategoryId();
}
$queryBuilder->linkInner('p.categoryProducts', 'cp')->linkInner('cp.category', 'c')->addOrderBy('cp.orderby');
if (empty($this->currentSearchCnd->{self::P_SEARCH_IN_SUBCATS})) {
$queryBuilder->andWhere('c.category_id = :categoryId')->setParameter('categoryId', $value);
} elseif (!\XLite\Core\Database::getRepo('XLite\\Model\\Category')->addSubTreeCondition($queryBuilder, $value)) {
// TODO - add throw exception
}
}
示例2: addImportCondition
/**
* Get identifiers list for specified query builder object
*
* @param \Doctrine\ORM\QueryBuilder $qb Query builder
* @param string $name Name
* @param mixed $value Value
*
* @return void
*/
protected function addImportCondition(\Doctrine\ORM\QueryBuilder $qb, $name, $value)
{
if ('productClass' == $name && is_string($value)) {
$alias = $qb->getMainAlias();
$qb->linkInner($alias . '.productClass')->linkInner('productClass.translations', 'productClassTranslations')->andWhere('productClassTranslations.name = :productClass')->setParameter('productClass', $value);
} else {
$result = parent::addImportCondition($qb, $name, $value);
}
}
示例3: prepareCndProfile
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param mixed $value Condition data
*
* @return void
*/
protected function prepareCndProfile(\Doctrine\ORM\QueryBuilder $queryBuilder, $value)
{
if ($value instanceof \XLite\Model\Profile) {
$queryBuilder->linkInner('r.profile', 'u');
$queryBuilder->andWhere('u.profile_id = :profileId')->setParameter('profileId', $value->getProfileId());
}
}
示例4: addMarkupCondition
/**
* Adds markup condition to the query builder object
*
* @param \Doctrine\ORM\QueryBuilder $qb Query builder object
* @param \XLite\Logic\Order\Modifier\Shipping $modifier Shipping order modifier
* @param integer $zoneId Zone Id
*
* @return \Doctrine\ORM\QueryBuilder
*/
protected function addMarkupCondition(\Doctrine\ORM\QueryBuilder $qb, \XLite\Logic\Order\Modifier\Shipping $modifier, $zoneId)
{
$prepareSum = array('m.markup_flat', '(m.markup_percent * :value / 100)', '(m.markup_per_item * :items)', '(m.markup_per_weight * :weight)');
$qb->addSelect(implode(' + ', $prepareSum) . ' as markup_value')->linkInner('m.zone')->andWhere('zone.zone_id = :zoneId')->setParameter('zoneId', $zoneId)->setParameter('weight', $modifier->getWeight())->setParameter('items', $modifier->countItems())->setParameter('value', $modifier->getSubtotal());
$qb->linkInner('m.shipping_method');
$qb->andWhere($qb->expr()->orX($qb->expr()->andX('shipping_method.tableType = :WSIType', 'm.min_weight <= :weightCondition', 'm.max_weight >= :weightCondition', 'm.min_total <= :totalCondition', 'm.max_total >= :totalCondition', 'm.min_items <= :itemsCondition', 'm.max_items >= :itemsCondition'), $qb->expr()->andX('shipping_method.tableType = :WType', 'm.min_weight <= :weightCondition', 'm.max_weight >= :weightCondition'), $qb->expr()->andX('shipping_method.tableType = :SType', 'm.min_total <= :totalCondition', 'm.max_total >= :totalCondition'), $qb->expr()->andX('shipping_method.tableType = :IType', 'm.min_items <= :itemsCondition', 'm.max_items >= :itemsCondition')));
$qb->setParameter('totalCondition', $modifier->getSubtotalCondition())->setParameter('weightCondition', $modifier->getWeightCondition())->setParameter('itemsCondition', $modifier->countItemsCondition())->setParameter('WSIType', 'WSI')->setParameter('WType', 'W')->setParameter('SType', 'S')->setParameter('IType', 'I');
return $qb;
}
示例5: prepareCndOrder
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param array $value Condition data
*
* @return void
*/
protected function prepareCndOrder(\Doctrine\ORM\QueryBuilder $queryBuilder, $value)
{
$queryBuilder->linkInner('p.order', 'pbOrder')->andWhere('pbOrder.order = :order')->setParameter('order', $value->getOrderId());
}
示例6: prepareCndAttribute
/**
* Prepare certain search condition
*
* @param \Doctrine\ORM\QueryBuilder $queryBuilder Query builder to prepare
* @param mixed $value Condition OPTIONAL
*
* @return void
*/
protected function prepareCndAttribute(\Doctrine\ORM\QueryBuilder $queryBuilder, $value = null)
{
if ($value) {
if (is_object($value)) {
$queryBuilder->andWhere('a.attribute = :attribute');
} else {
$queryBuilder->linkInner('a.attribute')->andWhere('attribute.id = :attribute');
}
$queryBuilder->setParameter('attribute', $value);
}
}