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


PHP ParameterContainer::count方法代码示例

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


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

示例1: execute

 /**
  * Execute
  *
  * @param  ParameterContainer|null $parameters
  * @throws Exception\InvalidQueryException
  * @return Result
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared()) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     if ($this->parameterContainer->count() > 0) {
         $parameters = $this->parameterContainer->getPositionalArray();
     }
     /** END Standard ParameterContainer Merging Block */
     if ($this->profiler) {
         $this->profiler->profilerStart($this);
     }
     $resultResource = pg_execute($this->pgsql, $this->statementName, (array) $parameters);
     if ($this->profiler) {
         $this->profiler->profilerFinish();
     }
     if ($resultResource === false) {
         throw new Exception\InvalidQueryException(pg_last_error());
     }
     $result = $this->driver->createResult($resultResource);
     return $result;
 }
开发者ID:idwsdta,项目名称:INIT-frame,代码行数:41,代码来源:Statement.php

示例2: execute

 /**
  * @param mixed $parameters
  * @throws Exception\InvalidQueryException
  * @return Result
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     if ($this->parameterContainer->count() > 0) {
         $this->bindParametersFromContainer();
     }
     /** END Standard ParameterContainer Merging Block */
     try {
         $this->resource->execute();
     } catch (\PDOException $e) {
         throw new Exception\InvalidQueryException('Statement could not be executed', null, $e);
     }
     $result = $this->driver->createResult($this->resource, $this);
     return $result;
 }
开发者ID:Baft,项目名称:Zend-Form,代码行数:34,代码来源:Statement.php

示例3: execute

 /**
  * Execute
  *
  * @param  ParameterContainer $parameters
  * @return mixed
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     if ($this->parameterContainer->count() > 0) {
         $this->bindParametersFromContainer();
     }
     /** END Standard ParameterContainer Merging Block */
     if ($this->resource->execute() === false) {
         throw new Exception\RuntimeException($this->resource->error);
     }
     if ($this->bufferResults === true) {
         $this->resource->store_result();
         $this->isPrepared = false;
         $buffered = true;
     } else {
         $buffered = false;
     }
     $result = $this->driver->createResult($this->resource, $buffered);
     return $result;
 }
开发者ID:Rovak,项目名称:zf2,代码行数:40,代码来源:Statement.php

示例4: execute

 /**
  * Execute
  *
  * @param  ParameterContainer $parameters
  * @return mixed
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     if ($this->parameterContainer->count() > 0) {
         $this->bindParametersFromContainer();
     }
     /** END Standard ParameterContainer Merging Block */
     if ($this->profiler) {
         $this->profiler->profilerStart($this);
     }
     if ($this->driver->getConnection()->inTransaction()) {
         $ret = @oci_execute($this->resource, OCI_NO_AUTO_COMMIT);
     } else {
         $ret = @oci_execute($this->resource, OCI_COMMIT_ON_SUCCESS);
     }
     if ($this->profiler) {
         $this->profiler->profilerFinish();
     }
     if ($ret === false) {
         $e = oci_error($this->resource);
         throw new Exception\RuntimeException($e['message'], $e['code']);
     }
     $result = $this->driver->createResult($this->resource);
     return $result;
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:45,代码来源:Statement.php

示例5: testCount

 /**
  * @testdox unit test: Test count() returns the proper count
  * @covers Zend\Db\Adapter\ParameterContainer::count
  */
 public function testCount()
 {
     $this->assertEquals(1, $this->parameterContainer->count());
 }
开发者ID:rajanlamic,项目名称:IntTest,代码行数:8,代码来源:ParameterContainerTest.php

示例6: execute

 /**
  * Execute
  *
  * @param  ParameterContainer|array   $parameters
  * @throws Exception\RuntimeException
  * @return mixed
  */
 public function execute($parameters = null)
 {
     if (!$this->isPrepared) {
         $this->prepare();
     }
     /** START Standard ParameterContainer Merging Block */
     if (!$this->parameterContainer instanceof ParameterContainer) {
         if ($parameters instanceof ParameterContainer) {
             $this->parameterContainer = $parameters;
             $parameters = null;
         } else {
             $this->parameterContainer = new ParameterContainer();
         }
     }
     if (is_array($parameters)) {
         $this->parameterContainer->setFromArray($parameters);
     }
     if ($this->parameterContainer->count() > 0) {
         $this->bindParametersFromContainer();
     }
     /** END Standard ParameterContainer Merging Block */
     if ($this->profiler) {
         $this->profiler->profilerStart($this);
     }
     if ($this->bufferResults === true) {
         //            $this -> resource -> store_result();
         //            $this -> isPrepared = false;
         $buffered = true;
     } else {
         $buffered = false;
     }
     if ($this->sql instanceof \MongoZend\Db\NoSql\Select) {
         $_order = $this->sql->getOrder();
         //            , $this -> sql->getColumns()
         $return = $this->resource->find($this->sql->getWhere());
         if (!empty($_order)) {
             foreach ($_order as $_k => $_v) {
                 if (strtolower($_v) == 'desc' || $_v < 0) {
                     $_order[$_k] = -1;
                 } else {
                     $_order[$_k] = 1;
                 }
             }
             $return = $return->sort($_order);
         }
         if ($this->sql->getLimit() !== null) {
             $return = $return->limit($this->sql->getLimit());
         }
         if ($this->sql->getOffset() !== null) {
             $return = $return->skip($this->sql->getOffset());
         }
     } elseif ($this->sql instanceof \MongoZend\Db\NoSql\Insert) {
         $_data = $this->sql->getValues();
         $return = $this->resource->insert($_data);
         $buffered = $this->sql->getRawState()['table'];
         $this->driver->getConnection()->storeLastGeneratedValue($buffered, $_data['_id']);
         //          $return = $this -> resource -> update( [ '_id' => $_data[ '_id' ] ], [ '$set' => array( "id" => (string) $_data[ '_id' ] ) ] );
     } elseif ($this->sql instanceof \MongoZend\Db\NoSql\Update) {
         $_data = $this->sql->getSet();
         $_where = $this->sql->getWhere();
         $return = $this->resource->update($_where, $_data);
         $buffered = $this->sql->getRawState()['table'];
         $this->driver->getConnection()->storeLastGeneratedValue($buffered, $_data['_id']);
     } elseif ($this->sql instanceof \MongoZend\Db\NoSql\Delete) {
         $_where = $this->sql->getWhere();
         $return = $this->resource->remove($_where);
         $buffered = $this->sql->getRawState()['table'];
         $this->driver->getConnection()->storeLastGeneratedValue($buffered, null);
     } else {
         $return = $this->resource->execute();
     }
     if ($this->profiler) {
         $this->profiler->profilerFinish();
     }
     if ($return === false) {
         throw new Exception\RuntimeException($this->getDriver()->getConnection()->getDB()->lastError());
     }
     $result = $this->driver->createResult($return, $buffered);
     return $result;
 }
开发者ID:pasechnik,项目名称:mongozend,代码行数:87,代码来源:Statement.php


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