當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。