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


PHP QueryBuilder::insert方法代码示例

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


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

示例1: insertQuotesIdentifierAndDelegatesToConcreteQueryBuilder

 /**
  * @test
  */
 public function insertQuotesIdentifierAndDelegatesToConcreteQueryBuilder()
 {
     $this->connection->quoteIdentifier('aTable')->shouldBeCalled()->willReturnArgument(0);
     $this->concreteQueryBuilder->insert(Argument::exact('aTable'))->shouldBeCalled()->willReturn($this->subject);
     $this->subject->insert('aTable');
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:9,代码来源:QueryBuilderTest.php

示例2: addUser

 public function addUser($data)
 {
     $queryBuilder = new QueryBuilder($this->db);
     $queryBuilder->insert('users')->values(['email' => '?', 'password' => '?', 'key_activation' => '?'])->setParameter(0, $data['email'])->setParameter(1, $this->_hashPassword($data['password']))->setParameter(2, bin2hex(openssl_random_pseudo_bytes(10)));
     return $queryBuilder->execute();
 }
开发者ID:anthonypelletier,项目名称:RPI-CallFilter-Web,代码行数:6,代码来源:UserModel.php

示例3: addNumber

 public function addNumber($data)
 {
     $queryBuilder = new QueryBuilder($this->db);
     $queryBuilder->insert('numbers')->values(['user_id' => '?', 'number' => '?'])->setParameter(0, $this->id_user)->setParameter(1, $data['number']);
     return $queryBuilder->execute();
 }
开发者ID:anthonypelletier,项目名称:RPI-CallFilter-Web,代码行数:6,代码来源:NumberModel.php

示例4: testEmptyInsert

 public function testEmptyInsert()
 {
     $qb = new QueryBuilder($this->conn);
     $qb2 = $qb->insert();
     $this->assertEquals(QueryBuilder::INSERT, $qb->getType());
     $this->assertSame($qb2, $qb);
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:7,代码来源:QueryBuilderTest.php

示例5: insert

 /**
  * Turns the query being built into an insert query that inserts into
  * a certain table
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->insert('users')
  *         ->values(
  *             array(
  *                 'name' => '?',
  *                 'password' => '?'
  *             )
  *         );
  * </code>
  *
  * @param string $insert The table into which the rows should be inserted.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function insert($insert = null)
 {
     $this->queryBuilder->insert($this->getTableName($insert));
     $this->lastInsertedTable = $insert;
     return $this;
 }
开发者ID:rchicoli,项目名称:owncloud-core,代码行数:25,代码来源:QueryBuilder.php

示例6: addCommande

 public function addCommande($data)
 {
     $queryBuilder = new QueryBuilder($this->db);
     $queryBuilder->insert('commandes')->values(['id_etat' => '?', 'user_id' => '?', 'prix' => '?', 'date_achat' => '?'])->setParameter(0, 0)->setParameter(1, $data['id'])->setParameter(2, 23.99)->setParameter(3, date('Y-m-d'));
     return $queryBuilder->execute();
 }
开发者ID:anthonypelletier,项目名称:RPI-CallFilter-Web,代码行数:6,代码来源:CommandesModel.php

示例7: insert

 /**
  * Turns the query being built into an insert query that inserts into
  * a certain table
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->insert('users')
  *         ->values(
  *             array(
  *                 'name' => '?',
  *                 'password' => '?'
  *             )
  *         );
  * </code>
  *
  * @param string $insert The table into which the rows should be inserted.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function insert($insert = null)
 {
     $this->queryBuilder->insert($this->helper->quoteColumnName($insert));
     return $this;
 }
开发者ID:henkRW,项目名称:core,代码行数:24,代码来源:querybuilder.php


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