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


PHP ParameterContainer::merge方法代码示例

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


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

示例1: processHaving

 protected function processHaving(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->having->count() == 0) {
         return null;
     }
     $whereParts = $this->processExpression($this->having, $platform, $adapter, $this->processInfo['paramPrefix'] . 'having');
     if ($parameterContainer) {
         $parameterContainer->merge($whereParts->getParameterContainer());
     }
     return array($whereParts->getSql());
 }
开发者ID:Rovak,项目名称:zf2,代码行数:11,代码来源:Select.php

示例2: processSubSelect

 protected function processSubSelect(Select $subselect, PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($driver) {
         $stmtContainer = new StatementContainer();
         // Track subselect prefix and count for parameters
         $this->processInfo['subselectCount']++;
         $subselect->processInfo['subselectCount'] = $this->processInfo['subselectCount'];
         $subselect->processInfo['paramPrefix'] = 'subselect' . $subselect->processInfo['subselectCount'];
         // call subselect
         $subselect->prepareStatement(new \Zend\Db\Adapter\Adapter($driver, $platform), $stmtContainer);
         // copy count
         $this->processInfo['subselectCount'] = $subselect->processInfo['subselectCount'];
         $parameterContainer->merge($stmtContainer->getParameterContainer()->getNamedArray());
         $sql = $stmtContainer->getSql();
     } else {
         $sql = $subselect->getSqlString($platform);
     }
     return $sql;
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:19,代码来源:AbstractSql.php

示例3: processOrder

 protected function processOrder(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if (empty($this->order)) {
         return null;
     }
     $orders = array();
     foreach ($this->order as $k => $v) {
         if ($v instanceof Expression) {
             /** @var $orderParts \Zend\Db\Adapter\StatementContainer */
             $orderParts = $this->processExpression($v, $platform, $adapter);
             if ($parameterContainer) {
                 $parameterContainer->merge($orderParts->getParameterContainer());
             }
             $orders[] = array($orderParts->getSql());
             continue;
         }
         if (is_int($k)) {
             if (strpos($v, ' ') !== false) {
                 list($k, $v) = preg_split('# #', $v, 2);
             } else {
                 $k = $v;
                 $v = self::ORDER_ASCENDING;
             }
         }
         if (strtoupper($v) == self::ORDER_DESCENDING) {
             $orders[] = array($platform->quoteIdentifierInFragment($k), self::ORDER_DESCENDING);
         } else {
             $orders[] = array($platform->quoteIdentifierInFragment($k), self::ORDER_ASCENDING);
         }
     }
     return array($orders);
 }
开发者ID:nuklehed,项目名称:zf2,代码行数:32,代码来源:Select.php

示例4: processHaving

 protected function processHaving(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->having->count() == 0) {
         return null;
     }
     $whereParts = $this->processExpression($this->having, $platform, $adapter ? $adapter->getDriver() : null, 'having');
     if (count($whereParts['parameters']) > 0) {
         $parameterContainer->merge($whereParts['parameters']);
     }
     return array($whereParts['sql']);
 }
开发者ID:nazrulworld,项目名称:zf2,代码行数:11,代码来源:Select.php

示例5: processJoins

 protected function processJoins(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if (!$this->joins) {
         return null;
     }
     // process joins
     $joinSpecArgArray = array();
     foreach ($this->joins as $j => $join) {
         $joinSpecArgArray[$j] = array();
         // type
         $joinSpecArgArray[$j][] = strtoupper($join['type']);
         // table name
         $joinSpecArgArray[$j][] = is_array($join['name']) ? $platform->quoteIdentifier(current($join['name'])) . ' ' . $platform->quoteIdentifier(key($join['name'])) : $platform->quoteIdentifier($join['name']);
         // on expression
         $joinSpecArgArray[$j][] = $join['on'] instanceof ExpressionInterface ? $this->processExpression($join['on'], $platform, $driver, $this->processInfo['paramPrefix'] . 'join') : $platform->quoteIdentifierInFragment($join['on'], array('=', 'AND', 'OR', '(', ')', 'BETWEEN'));
         // on
         if ($joinSpecArgArray[$j][2] instanceof StatementContainerInterface) {
             if ($parameterContainer) {
                 $parameterContainer->merge($joinSpecArgArray[$j][2]->getParameterContainer());
             }
             $joinSpecArgArray[$j][2] = $joinSpecArgArray[$j][2]->getSql();
         }
     }
     return array($joinSpecArgArray);
 }
开发者ID:ErR163,项目名称:torrentpier,代码行数:25,代码来源:SelectDecorator.php

示例6: processOption

 protected function processOption(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if (empty($this->option)) {
         return null;
     }
     // process options
     $options = array();
     foreach ($this->option as $optName => $optValue) {
         $optionSql = '';
         if ($optValue instanceof Expression) {
             $parameterPrefix = $this->processInfo['paramPrefix'] . 'option';
             $optionParts = $this->processExpression($optValue, $platform, $driver, $parameterPrefix);
             if ($parameterContainer) {
                 $parameterContainer->merge($optionParts->getParameterContainer());
             }
             $optionSql .= $optionParts->getSql();
         } else {
             if ($driver && $parameterContainer) {
                 $parameterContainer->offsetSet('option_' . $optName, $optValue);
                 $optionSql .= $driver->formatParameterName('option_' . $optName);
             } else {
                 $optionSql .= $platform->quoteValue($optValue);
             }
         }
         $options[] = array($platform->quoteIdentifier($optName), $optionSql);
     }
     return array($options);
 }
开发者ID:joacub,项目名称:sphinxsearch,代码行数:28,代码来源:Update.php

示例7: processSubSelect

 protected function processSubSelect(Select $subselect, PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($driver) {
         $stmtContainer = new StatementContainer();
         // Track subselect prefix and count for parameters
         $this->processInfo['subselectCount']++;
         $subselect->processInfo['subselectCount'] = $this->processInfo['subselectCount'];
         $subselect->processInfo['paramPrefix'] = 'subselect' . $subselect->processInfo['subselectCount'];
         // call subselect
         if ($this instanceof PlatformDecoratorInterface) {
             /** @var Select|PlatformDecoratorInterface $subselectDecorator */
             $subselectDecorator = clone $this;
             $subselectDecorator->setSubject($subselect);
             $subselectDecorator->prepareStatement(new Adapter($driver, $platform), $stmtContainer);
         } else {
             $subselect->prepareStatement(new Adapter($driver, $platform), $stmtContainer);
         }
         // copy count
         $this->processInfo['subselectCount'] = $subselect->processInfo['subselectCount'];
         $parameterContainer->merge($stmtContainer->getParameterContainer()->getNamedArray());
         $sql = $stmtContainer->getSql();
     } else {
         if ($this instanceof PlatformDecoratorInterface) {
             $subselectDecorator = clone $this;
             $subselectDecorator->setSubject($subselect);
             $sql = $subselectDecorator->getSqlString($platform);
         } else {
             $sql = $subselect->getSqlString($platform);
         }
     }
     return $sql;
 }
开发者ID:tillk,项目名称:vufind,代码行数:32,代码来源:AbstractSql.php


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