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


PHP ParameterContainer::offsetHasErrata方法代码示例

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


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

示例1: bindParametersFromContainer

 /**
  * Bind parameters from container
  */
 protected function bindParametersFromContainer()
 {
     if ($this->parametersBound) {
         return;
     }
     $parameters = $this->parameterContainer->getNamedArray();
     foreach ($parameters as $name => &$value) {
         if (is_bool($value)) {
             $type = \PDO::PARAM_BOOL;
         } else {
             $type = \PDO::PARAM_STR;
         }
         if ($this->parameterContainer->offsetHasErrata($name)) {
             switch ($this->parameterContainer->offsetGetErrata($name)) {
                 case ParameterContainer::TYPE_INTEGER:
                     $type = \PDO::PARAM_INT;
                     break;
                 case ParameterContainer::TYPE_NULL:
                     $type = \PDO::PARAM_NULL;
                     break;
                 case ParameterContainer::TYPE_LOB:
                     $type = \PDO::PARAM_LOB;
                     break;
             }
         }
         // parameter is named or positional, value is reference
         $parameter = is_int($name) ? $name + 1 : $name;
         $this->resource->bindParam($parameter, $value, $type);
     }
 }
开发者ID:eltonoliveira,项目名称:jenkins,代码行数:33,代码来源:Statement.php

示例2: bindParametersFromContainer

 /**
  * Bind parameters from container
  *
  * @return void
  */
 protected function bindParametersFromContainer()
 {
     $parameters = $this->parameterContainer->getNamedArray();
     $type = '';
     $args = array();
     foreach ($parameters as $name => &$value) {
         if ($this->parameterContainer->offsetHasErrata($name)) {
             switch ($this->parameterContainer->offsetGetErrata($name)) {
                 case ParameterContainer::TYPE_DOUBLE:
                     $type .= 'd';
                     break;
                 case ParameterContainer::TYPE_NULL:
                     $value = null;
                     // as per @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php#96148
                 // as per @see http://www.php.net/manual/en/mysqli-stmt.bind-param.php#96148
                 case ParameterContainer::TYPE_INTEGER:
                     $type .= 'i';
                     break;
                 case ParameterContainer::TYPE_STRING:
                 default:
                     $type .= 's';
                     break;
             }
         } else {
             $type .= 's';
         }
         $args[] =& $value;
     }
     if ($args) {
         array_unshift($args, $type);
         call_user_func_array(array($this->resource, 'bind_param'), $args);
     }
 }
开发者ID:Yansor,项目名称:yafblog,代码行数:38,代码来源:Statement.php

示例3: bindParametersFromContainer

 /**
  * Bind parameters from container
  *
  * @param ParameterContainer $pContainer
  */
 protected function bindParametersFromContainer()
 {
     $parameters = $this->parameterContainer->getNamedArray();
     foreach ($parameters as $name => &$value) {
         if ($this->parameterContainer->offsetHasErrata($name)) {
             switch ($this->parameterContainer->offsetGetErrata($name)) {
                 case ParameterContainer::TYPE_NULL:
                     $type = null;
                     $value = null;
                     break;
                 case ParameterContainer::TYPE_DOUBLE:
                 case ParameterContainer::TYPE_INTEGER:
                     $type = SQLT_INT;
                     if (is_string($value)) {
                         $value = (int) $value;
                     }
                     break;
                 case ParameterContainer::TYPE_BINARY:
                     $type = SQLT_BIN;
                     break;
                 case ParameterContainer::TYPE_STRING:
                 default:
                     $type = SQLT_CHR;
                     break;
             }
         } else {
             $type = SQLT_CHR;
         }
         oci_bind_by_name($this->resource, $name, $value, -1, $type);
     }
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:36,代码来源:Statement.php

示例4: bindParametersFromContainer

 /**
  * Bind parameters from container
  *
  * @param ParameterContainer $pContainer
  */
 protected function bindParametersFromContainer()
 {
     $parameters = $this->parameterContainer->getNamedArray();
     foreach ($parameters as $name => &$value) {
         if ($this->parameterContainer->offsetHasErrata($name)) {
             switch ($this->parameterContainer->offsetGetErrata($name)) {
                 case ParameterContainer::TYPE_NULL:
                     $type = null;
                     $value = null;
                     break;
                 case ParameterContainer::TYPE_DOUBLE:
                 case ParameterContainer::TYPE_INTEGER:
                     $type = SQLT_INT;
                     if (is_string($value)) {
                         $value = (int) $value;
                     }
                     break;
                 case ParameterContainer::TYPE_BINARY:
                     $type = SQLT_BIN;
                     break;
                 case ParameterContainer::TYPE_LOB:
                     $type = OCI_B_CLOB;
                     $clob = oci_new_descriptor($this->driver->getConnection()->getResource(), OCI_DTYPE_LOB);
                     $clob->writetemporary($value, OCI_TEMP_CLOB);
                     $value = $clob;
                     break;
                 case ParameterContainer::TYPE_STRING:
                 default:
                     $type = SQLT_CHR;
                     break;
             }
         } else {
             $type = SQLT_CHR;
         }
         $maxLength = -1;
         if ($this->parameterContainer->offsetHasMaxLength($name)) {
             $maxLength = $this->parameterContainer->offsetGetMaxLength($name);
         }
         oci_bind_by_name($this->resource, $name, $value, $maxLength, $type);
     }
 }
开发者ID:CHRISTOPHERVANDOMME,项目名称:zf2complet,代码行数:46,代码来源:Statement.php

示例5: bindParametersFromContainer

 /**
  * Bind parameters from container
  * 
  * @param ParameterContainer $container
  */
 protected function bindParametersFromContainer(ParameterContainer $container)
 {
     $parameters = $container->getNamedArray();
     foreach ($parameters as $position => &$value) {
         $type = \PDO::PARAM_STR;
         if ($container->offsetHasErrata($position)) {
             switch ($container->offsetGetErrata($position)) {
                 case ParameterContainer::TYPE_INTEGER:
                     $type = \PDO::PARAM_INT;
                     break;
                 case ParameterContainer::TYPE_NULL:
                     $type = \PDO::PARAM_NULL;
                     break;
                 case ParameterContainer::TYPE_LOB:
                     $type = \PDO::PARAM_LOB;
                     break;
                 case is_bool($value):
                     $type = \PDO::PARAM_BOOL;
                     break;
             }
         }
         // parameter is named or positional, value is reference
         $parameter = is_int($position) ? $position + 1 : $position;
         $this->resource->bindParam($parameter, $value, $type);
     }
 }
开发者ID:brikou,项目名称:zend_db,代码行数:31,代码来源:Statement.php

示例6: testOffsetHasErrata

 /**
  * @testdox unit test: Test offsetHasErrata() will check if errata exists for a particular key
  * @covers Zend\Db\Adapter\ParameterContainer::offsetHasErrata
  */
 public function testOffsetHasErrata()
 {
     $this->parameterContainer->offsetSetErrata('foo', ParameterContainer::TYPE_INTEGER);
     $this->assertTrue($this->parameterContainer->offsetHasErrata('foo'));
 }
开发者ID:rajanlamic,项目名称:IntTest,代码行数:9,代码来源:ParameterContainerTest.php


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