當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PlatformInterface::quoteIdentifier方法代碼示例

本文整理匯總了PHP中Zend\Db\Adapter\Platform\PlatformInterface::quoteIdentifier方法的典型用法代碼示例。如果您正苦於以下問題:PHP PlatformInterface::quoteIdentifier方法的具體用法?PHP PlatformInterface::quoteIdentifier怎麽用?PHP PlatformInterface::quoteIdentifier使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend\Db\Adapter\Platform\PlatformInterface的用法示例。


在下文中一共展示了PlatformInterface::quoteIdentifier方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: processTable

 /**
  * @param PlatformInterface $adapterPlatform
  * @return array
  */
 protected function processTable(PlatformInterface $adapterPlatform = null)
 {
     $ret = array('');
     if ($this->isTemporary) {
         $table = '#';
     } else {
         $table = '';
     }
     $ret[] = $adapterPlatform->quoteIdentifier($table . ltrim($this->table, '#'));
     return $ret;
 }
開發者ID:tillk,項目名稱:vufind,代碼行數:15,代碼來源:CreateTableDecorator.php

示例2: processChangeColumns

 protected function processChangeColumns(PlatformInterface $adapterPlatform = null)
 {
     /* @var Column\Column $column  */
     $sqls = [];
     foreach ($this->changeColumns as $name => $column) {
         if ($name !== $column->getName()) {
             trigger_error('One statement must rename a column, other separate statements must change table definition.', E_USER_DEPRECATED);
         }
         $default = $column->getDefault();
         $columnClass = get_class($column);
         $emptyColumn = new $columnClass(null, true);
         $emptyColumn->setOptions($column->getOptions());
         $sqls[] = [$adapterPlatform->quoteIdentifier($name), ' SET DATA TYPE' . $this->processExpression($emptyColumn, $adapterPlatform)];
         $sqls[] = [$adapterPlatform->quoteIdentifier($name), null !== $default ? ' SET ' . $this->processExpression(new DefaultValue($default), $adapterPlatform) : ' DROP DEFAULT'];
         $sqls[] = [$adapterPlatform->quoteIdentifier($name), $column->isNullable() ? ' DROP NOT NULL' : ' SET NOT NULL'];
     }
     return [$sqls];
 }
開發者ID:andrey-mokhov,項目名稱:anelegan-db,代碼行數:18,代碼來源:AlterTableDecorator.php

示例3: processInsert

 protected function processInsert(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->select) {
         return;
     }
     if (!$this->columns) {
         throw new InvalidArgumentException('values or select should be present');
     }
     $columns = [];
     $values = [];
     foreach ($this->columns as $column => $value) {
         $columns[] = $platform->quoteIdentifier($column);
         foreach ($value as $key => $item) {
             /* if (is_scalar($item) && $parameterContainer) {
                    $values[$key][] = $driver->formatParameterName($column);
                    $parameterContainer->offsetSet($column, $item);
                } else {*/
             $values[$key][] = $this->resolveColumnValue($item, $platform, $driver, $parameterContainer);
             /* }*/
         }
     }
     $strValues = '';
     foreach ($values as $value) {
         $strValues .= '(' . implode(', ', $value) . '),';
     }
     $strValues = rtrim($strValues, ',');
     $sql = sprintf($this->specifications[static::SPECIFICATION_INSERT], $this->resolveTable($this->table, $platform, $driver, $parameterContainer), implode(', ', $columns), $strValues);
     return $sql;
 }
開發者ID:avz-cmf,項目名稱:zaboy-rest,代碼行數:29,代碼來源:MultiInsert.php

示例4: processTable

 /**
  * @param PlatformInterface $adapterPlatform
  *
  * @return string[]
  */
 protected function processTable(PlatformInterface $adapterPlatform = null)
 {
     return array($this->isTemporary ? 'TEMPORARY ' : '', $adapterPlatform->quoteIdentifier($this->table));
 }
開發者ID:karnurik,項目名稱:zf2-turtorial,代碼行數:9,代碼來源:CreateTable.php

示例5: processTable

 protected function processTable(PlatformInterface $adapterPlatform = null)
 {
     return array($adapterPlatform->quoteIdentifier($this->table));
 }
開發者ID:leonardovn86,項目名稱:zf2_basic2013,代碼行數:4,代碼來源:DropTable.php

示例6: 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();
         $joinName = null;
         $joinAs = null;
         // type
         $joinSpecArgArray[$j][] = strtoupper($join['type']);
         // table name
         if (is_array($join['name'])) {
             $joinName = current($join['name']);
             $joinAs = $platform->quoteIdentifier(key($join['name']));
         } else {
             $joinName = $join['name'];
         }
         if ($joinName instanceof TableIdentifier) {
             $joinName = $joinName->getTableAndSchema();
             $joinName = $platform->quoteIdentifier($joinName[1]) . $platform->getIdentifierSeparator() . $platform->quoteIdentifier($joinName[0]);
         } else {
             if ($joinName instanceof Select) {
                 $joinName = '(' . $joinName->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')';
             } else {
                 $joinName = $platform->quoteIdentifier($joinName);
             }
         }
         $joinSpecArgArray[$j][] = isset($joinAs) ? $joinName . ' AS ' . $joinAs : $joinName;
         // on expression
         // note: for Expression objects, pass them to processExpression with a prefix specific to each join (used for named parameters)
         $joinSpecArgArray[$j][] = $join['on'] instanceof ExpressionInterface ? $this->processExpression($join['on'], $platform, $driver, $this->processInfo['paramPrefix'] . 'join' . ($j + 1) . 'part') : $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:AlexandrKozyr,項目名稱:ver_site,代碼行數:44,代碼來源:Select.php

示例7: processTable

 /**
  * @param PlatformInterface $adapterPlatform
  * @return array
  */
 protected function processTable(PlatformInterface $adapterPlatform = null)
 {
     $table = ($this->isTemporary ? '#' : '') . ltrim($this->table, '#');
     return ['', $adapterPlatform->quoteIdentifier($table)];
 }
開發者ID:KBO-Techo-Dev,項目名稱:MagazinePro-zf25,代碼行數:9,代碼來源:CreateTableDecorator.php

示例8: processDropConstraints

 protected function processDropConstraints(PlatformInterface $adapterPlatform = null)
 {
     $sqls = array();
     foreach ($this->dropConstraints as $constraint) {
         $sqls[] = $adapterPlatform->quoteIdentifier($constraint);
     }
     return array($sqls);
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:8,代碼來源:AlterTable.php

示例9: 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 (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_DESENDING) {
             $orders[] = array($platform->quoteIdentifier($k), self::ORDER_DESENDING);
         } else {
             $orders[] = array($platform->quoteIdentifier($k), self::ORDER_ASCENDING);
         }
     }
     return array($orders);
 }
開發者ID:necrogami,項目名稱:zf2,代碼行數:23,代碼來源:Select.php

示例10: processUpdate

 protected function processUpdate(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     $setSql = [];
     foreach ($this->set as $column => $value) {
         $prefix = $platform->quoteIdentifier($column) . ' = ';
         if (is_scalar($value) && $parameterContainer) {
             $setSql[] = $prefix . $driver->formatParameterName($column);
             $parameterContainer->offsetSet($column, $value);
         } else {
             $setSql[] = $prefix . $this->resolveColumnValue($value, $platform, $driver, $parameterContainer);
         }
     }
     return sprintf($this->specifications[static::SPECIFICATION_UPDATE], $this->resolveTable($this->table, $platform, $driver, $parameterContainer), implode(', ', $setSql));
 }
開發者ID:KBO-Techo-Dev,項目名稱:MagazinePro-zf25,代碼行數:14,代碼來源:Update.php

示例11: processJoin

 protected function processJoin(PlatformInterface $platform, Adapter $adapter = null, ParameterContainer $parameterContainer = null)
 {
     if (!$this->joins) {
         return null;
     }
     // process joins
     $joinSpecArgArray = array();
     foreach ($this->joins as $j => $join) {
         if (is_array($join['name'])) {
             $keys = array_keys($join['name']);
             $alias = array_pop($keys);
             $name = $join['name'][$alias];
             $nameArg = $platform->quoteIdentifier($name) . ' AS ' . $platform->quoteIdentifier($alias);
         } else {
             $nameArg = $platform->quoteIdentifier($join['name']);
         }
         $joinSpecArgArray[$j] = array();
         $joinSpecArgArray[$j][] = strtoupper($join['type']);
         // type
         $joinSpecArgArray[$j][] = $nameArg;
         // table
         $joinSpecArgArray[$j][] = $platform->quoteIdentifierInFragment($join['on'], array('=', 'AND', 'OR', '(', ')', 'BETWEEN'));
         // on
     }
     return array($joinSpecArgArray);
 }
開發者ID:navassouza,項目名稱:zf2,代碼行數:26,代碼來源:Select.php

示例12: processTable

 protected function processTable(PlatformInterface $adapterPlatform = null)
 {
     $ret = array();
     if ($this->isTemporary) {
         $ret[] = 'TEMPORARY';
     }
     $ret[] = $adapterPlatform->quoteIdentifier($this->table);
     return $ret;
 }
開發者ID:leonardovn86,項目名稱:zf2_basic2013,代碼行數:9,代碼來源:CreateTable.php

示例13: processRenameColumn

 protected function processRenameColumn(PlatformInterface $adapterPlatform = null)
 {
     $sqls = [];
     foreach ($this->renameColumn as $name => $column) {
         $sqls[] = [$adapterPlatform->quoteIdentifier($name), $this->processExpression($column, $adapterPlatform)];
     }
     return [$sqls];
 }
開發者ID:andrey-mokhov,項目名稱:anelegan-db,代碼行數:8,代碼來源:AlterTable.php

示例14: processJoins

 protected function processJoins(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if (!$this->joins) {
         return;
     }
     // process joins
     $joinSpecArgArray = [];
     foreach ($this->joins as $j => $join) {
         $joinName = null;
         $joinAs = null;
         // table name
         if (is_array($join['name'])) {
             $joinName = current($join['name']);
             $joinAs = $platform->quoteIdentifier(key($join['name']));
         } else {
             $joinName = $join['name'];
         }
         if ($joinName instanceof Expression) {
             $joinName = $joinName->getExpression();
         } elseif ($joinName instanceof TableIdentifier) {
             $joinName = $joinName->getTableAndSchema();
             $joinName = ($joinName[1] ? $platform->quoteIdentifier($joinName[1]) . $platform->getIdentifierSeparator() : '') . $platform->quoteIdentifier($joinName[0]);
         } elseif ($joinName instanceof Select) {
             $joinName = '(' . $this->processSubSelect($joinName, $platform, $driver, $parameterContainer) . ')';
         } elseif (is_string($joinName) || is_object($joinName) && is_callable([$joinName, '__toString'])) {
             $joinName = $platform->quoteIdentifier($joinName);
         } else {
             throw new Exception\InvalidArgumentException(sprintf('Join name expected to be Expression|TableIdentifier|Select|string, "%s" given', gettype($joinName)));
         }
         $joinSpecArgArray[$j] = [strtoupper($join['type']), $this->renderTable($joinName, $joinAs)];
         // on expression
         // note: for Expression objects, pass them to processExpression with a prefix specific to each join (used for named parameters)
         $joinSpecArgArray[$j][] = $join['on'] instanceof ExpressionInterface ? $this->processExpression($join['on'], $platform, $driver, $parameterContainer, 'join' . ($j + 1) . 'part') : $platform->quoteIdentifierInFragment($join['on'], ['=', 'AND', 'OR', '(', ')', 'BETWEEN', '<', '>']);
         // on
     }
     return [$joinSpecArgArray];
 }
開發者ID:kienbk1910,項目名稱:RDCAdmin,代碼行數:37,代碼來源:Select.php

示例15: processInsert

 protected function processInsert(PlatformInterface $platform, DriverInterface $driver = null, ParameterContainer $parameterContainer = null)
 {
     if ($this->select) {
         return;
     }
     if (!$this->columns) {
         throw new Exception\InvalidArgumentException('values or select should be present');
     }
     $columns = [];
     $values = [];
     foreach ($this->columns as $column => $value) {
         $columns[] = $platform->quoteIdentifier($column);
         if (is_scalar($value) && $parameterContainer) {
             $values[] = $driver->formatParameterName($column);
             $parameterContainer->offsetSet($column, $value);
         } else {
             $values[] = $this->resolveColumnValue($value, $platform, $driver, $parameterContainer);
         }
     }
     return sprintf($this->specifications[static::SPECIFICATION_INSERT], $this->resolveTable($this->table, $platform, $driver, $parameterContainer), implode(', ', $columns), implode(', ', $values));
 }
開發者ID:zendframework,項目名稱:zend-db,代碼行數:21,代碼來源:Insert.php


注:本文中的Zend\Db\Adapter\Platform\PlatformInterface::quoteIdentifier方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。