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


PHP QueryBuilder::linkInner方法代码示例

本文整理汇总了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
     }
 }
开发者ID:kewaunited,项目名称:xcart,代码行数:20,代码来源:Product.php

示例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);
     }
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:18,代码来源:Attribute.php

示例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());
     }
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:15,代码来源:Review.php

示例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;
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:18,代码来源:Markup.php

示例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());
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:12,代码来源:PBParcel.php

示例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);
     }
 }
开发者ID:kirkbauer2,项目名称:kirkxc,代码行数:19,代码来源:AttributeOption.php


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