當前位置: 首頁>>代碼示例>>PHP>>正文


PHP QueryBuilder::add方法代碼示例

本文整理匯總了PHP中Doctrine\DBAL\Query\QueryBuilder::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP QueryBuilder::add方法的具體用法?PHP QueryBuilder::add怎麽用?PHP QueryBuilder::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\DBAL\Query\QueryBuilder的用法示例。


在下文中一共展示了QueryBuilder::add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add

 public function add($sqlPartName, $sqlPart, $append = false)
 {
     if ($sqlPartName == 'select') {
         if (is_array($sqlPart)) {
             $i = 0;
             foreach ($sqlPart as $term) {
                 $sqlPart[$i] = $this->quoteSelectTerm($term);
                 $i++;
             }
         } else {
             $sqlPart = $this->quoteSelectTerm($sqlPart);
         }
     }
     return parent::add($sqlPartName, $sqlPart, $append);
 }
開發者ID:GruppoMeta,項目名稱:Movio,代碼行數:15,代碼來源:QueryBuilder.php

示例2: addDelegatesToConcreteQueryBuilder

 /**
  * @test
  */
 public function addDelegatesToConcreteQueryBuilder()
 {
     $this->concreteQueryBuilder->add(Argument::exact('select'), Argument::exact('aField'), Argument::cetera())->shouldBeCalled()->willReturn($this->subject);
     $this->subject->add('select', 'aField');
 }
開發者ID:dachcom-digital,項目名稱:TYPO3.CMS,代碼行數:8,代碼來源:QueryBuilderTest.php

示例3: testApplyAnonymous

 /**
  * @covers Kunstmaan\AdminBundle\Helper\Security\Acl\AclNativeHelper::apply
  */
 public function testApplyAnonymous()
 {
     $queryBuilder = new QueryBuilder($this->conn);
     $queryBuilder->add('from', array(array('table' => 'myTable', 'alias' => 'n')));
     $roles = array();
     $this->token->expects($this->once())->method('getRoles')->will($this->returnValue($roles));
     $this->rh->expects($this->once())->method('getReachableRoles')->with($roles)->will($this->returnValue($roles));
     $this->token->expects($this->any())->method('getUser')->will($this->returnValue('anon.'));
     $permissionDef = new PermissionDefinition(array('view'), 'Kunstmaan\\NodeBundle\\Entity\\Node', 'n');
     /* @var $qb QueryBuilder */
     $qb = $this->object->apply($queryBuilder, $permissionDef);
     $query = $qb->getSQL();
     $this->assertContains('"IS_AUTHENTICATED_ANONYMOUSLY"', $query);
 }
開發者ID:axelvnk,項目名稱:KunstmaanBundlesCMS,代碼行數:17,代碼來源:AclNativeHelperTest.php

示例4: add

 /**
  * Either appends to or replaces a single, generic query part.
  *
  * The available parts are: 'select', 'from', 'set', 'where',
  * 'groupBy', 'having' and 'orderBy'.
  *
  * @param string  $sqlPartName
  * @param string  $sqlPart
  * @param boolean $append
  *
  * @return self
  */
 public function add($sqlPartName, $sqlPart, $append = false)
 {
     $this->qb->add($sqlPartName, $sqlPart, $append);
     return $this;
 }
開發者ID:Maksold,項目名稱:platform,代碼行數:17,代碼來源:SqlQueryBuilder.php


注:本文中的Doctrine\DBAL\Query\QueryBuilder::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。