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


PHP ProxyQueryInterface::getQueryBuilder方法代码示例

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


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

示例1: addIdentifiersToQuery

 /**
  * {@inheritdoc}
  */
 public function addIdentifiersToQuery($class, ProxyQueryInterface $queryProxy, array $idx)
 {
     $fieldNames = $this->getIdentifierFieldNames($class);
     $qb = $queryProxy->getQueryBuilder();
     $prefix = uniqid();
     $sqls = array();
     foreach ($idx as $pos => $id) {
         $ids = explode(self::ID_SEPARATOR, $id);
         $ands = array();
         foreach ($fieldNames as $posName => $name) {
             $parameterName = sprintf('field_%s_%s_%d', $prefix, $name, $pos);
             $ands[] = sprintf('%s.%s = :%s', $qb->getRootAlias(), $name, $parameterName);
             $qb->setParameter($parameterName, $ids[$posName]);
         }
         $sqls[] = implode(' AND ', $ands);
     }
     $qb->andWhere(sprintf('( %s )', implode(' OR ', $sqls)));
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:21,代码来源:ModelManager.php

示例2: addIdentifiersToQuery

 /**
  * {@inheritdoc}
  */
 public function addIdentifiersToQuery($class, ProxyQueryInterface $queryProxy, array $idx)
 {
     $queryBuilder = $queryProxy->getQueryBuilder();
     $queryBuilder->field('_id')->in($idx);
 }
开发者ID:jdshao,项目名称:symfony_backstage,代码行数:8,代码来源:ModelManager.php

示例3: addIdentifiersToQuery

 /**
  * {@inheritDoc}
  */
 public function addIdentifiersToQuery($class, ProxyQueryInterface $queryProxy, array $idx)
 {
     /** @var $queryProxy ProxyQuery */
     $qb = $queryProxy->getQueryBuilder();
     $orX = $qb->andWhere()->orX();
     foreach ($idx as $id) {
         $path = $this->getBackendId($id);
         $orX->same($path, $queryProxy->getAlias());
     }
 }
开发者ID:Aaike,项目名称:SonataDoctrinePhpcrAdminBundle,代码行数:13,代码来源:ModelManager.php

示例4: callbackMethod

 public function callbackMethod(ProxyQueryInterface $proxyQuery, $alias, $field, $data)
 {
     $queryBuilder = $proxyQuery->getQueryBuilder();
     $queryBuilder->andWhere()->eq()->field('a.' . $field)->literal($data['value']);
     return true;
 }
开发者ID:Aaike,项目名称:SonataDoctrinePhpcrAdminBundle,代码行数:6,代码来源:CallBackFilterTest.php


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