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


PHP QueryBuilder::setParameters方法代码示例

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


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

示例1: incorporateDbalQueryBuilder

 /**
  * @internal
  */
 private function incorporateDbalQueryBuilder(QueryBuilder $qb, FilterInterface $filter)
 {
     $criteria = $this->getFilteringCriteria($filter);
     // extraindo os rootAliases, pois o DBAL\QueryBuilder não tem
     $fromPart = $qb->getQueryPart('from');
     $rootAliases = array();
     foreach ($fromPart as $part) {
         $rootAliases[] = $part['alias'];
     }
     $visitor = new DbalQueryExpressionVisitor($qb->getConnection(), $rootAliases, $this->fieldMap);
     if ($whereExpression = $criteria->getWhereExpression()) {
         $qb->andWhere($visitor->dispatch($whereExpression));
         $qb->setParameters($visitor->getParameters());
     }
     if ($criteria->getOrderings()) {
         foreach ($criteria->getOrderings() as $sort => $order) {
             $qb->addOrderBy($visitor->getFieldName($sort), $order);
         }
     }
     if (($firstResult = $criteria->getFirstResult()) !== null) {
         $qb->setFirstResult($firstResult);
     }
     if (($maxResults = $criteria->getMaxResults()) !== null) {
         $qb->setMaxResults($maxResults);
     }
 }
开发者ID:brodaproject,项目名称:broda,代码行数:29,代码来源:DbalQueryBuilderIncorporator.php

示例2: setParametersDelegatesToConcreteQueryBuilder

 /**
  * @test
  */
 public function setParametersDelegatesToConcreteQueryBuilder()
 {
     $this->concreteQueryBuilder->setParameters(Argument::exact(['aField' => 'aValue']), Argument::exact([]))->shouldBeCalled()->willReturn($this->subject);
     $this->subject->setParameters(['aField' => 'aValue']);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:8,代码来源:QueryBuilderTest.php

示例3: setParameters

 /**
  * Sets a collection of query parameters for the query being constructed.
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->select('u')
  *         ->from('users', 'u')
  *         ->where('u.id = :user_id1 OR u.id = :user_id2')
  *         ->setParameters(array(
  *             ':user_id1' => 1,
  *             ':user_id2' => 2
  *         ));
  * </code>
  *
  * @param array $params The query parameters to set.
  * @param array $types The query parameters types to set.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function setParameters(array $params, array $types = array())
 {
     $this->queryBuilder->setParameters($params, $types);
     return $this;
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:24,代码来源:QueryBuilder.php

示例4: setParameters

 /**
  * Sets a collection of query parameters for the query being constructed.
  *
  * @param array $params The query parameters to set.
  * @param array $types  The query parameters types to set.
  *
  * @return self
  */
 public function setParameters(array $params, array $types = [])
 {
     $this->qb->setParameters($params, $types);
     return $this;
 }
开发者ID:Maksold,项目名称:platform,代码行数:13,代码来源:SqlQueryBuilder.php

示例5: setParameters

 /**
  * paramTypes is private, we need to redefine setParameters
  * to access it
  *
  * @param array $params
  * @param array $types
  *
  * @return $this
  */
 public function setParameters(array $params, array $types = array())
 {
     $this->paramTypes = $types;
     return parent::setParameters($params, $types);
 }
开发者ID:Volyz,项目名称:barometre,代码行数:14,代码来源:QueryBuilder.php


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