当前位置: 首页>>代码示例>>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;未经允许,请勿转载。