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


PHP Connection::getAttribute方法代码示例

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


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

示例1: topString

	protected function topString()
	{
		if ($this->limit !== NULL && $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME) === 'dblib') {
			return " TOP ($this->limit)"; //! offset is not supported
		}
		return '';
	}
开发者ID:norbe,项目名称:nette,代码行数:7,代码来源:Selection.php

示例2: __construct

 public function __construct($tableName, Connection $connection, IReflection $reflection)
 {
     $this->tableName = $tableName;
     $this->databaseReflection = $reflection;
     $this->driver = $connection->getSupplementalDriver();
     $this->driverName = $connection->getAttribute(\PDO::ATTR_DRIVER_NAME);
     $this->delimitedTable = $this->tryDelimite($tableName);
 }
开发者ID:ppwalks33,项目名称:cleansure,代码行数:8,代码来源:SqlBuilder.php

示例3: buildTopClause

 protected function buildTopClause()
 {
     if ($this->limit !== NULL && $this->connection->getAttribute(PDO::ATTR_DRIVER_NAME) === 'dblib') {
         return " TOP ({$this->limit})";
         //! offset is not supported
     }
     return '';
 }
开发者ID:cujan,项目名称:atlas-mineralov-a-hornin,代码行数:8,代码来源:SqlBuilder.php

示例4: addWhere

 public function addWhere($condition, $parameters = array())
 {
     $args = func_get_args();
     $hash = md5(json_encode($args));
     if (isset($this->conditions[$hash])) {
         return false;
     }
     $this->conditions[$hash] = $condition;
     $condition = $this->removeExtraTables($condition);
     $condition = $this->tryDelimite($condition);
     if (count($args) !== 2 || strpbrk($condition, '?:')) {
         // where('column < ? OR column > ?', array(1, 2))
         if (count($args) !== 2 || !is_array($parameters)) {
             // where('column < ? OR column > ?', 1, 2)
             $parameters = $args;
             array_shift($parameters);
         }
         $this->parameters = array_merge($this->parameters, $parameters);
     } elseif ($parameters === null) {
         // where('column', NULL)
         $condition .= ' IS NULL';
     } elseif ($parameters instanceof Selection) {
         // where('column', $db->$table())
         $clone = clone $parameters;
         if (!$clone->getSqlBuilder()->select) {
             $clone->select($clone->primary);
         }
         if ($this->connection->getAttribute(PDO::ATTR_DRIVER_NAME) !== 'mysql') {
             $condition .= ' IN (' . $clone->getSql() . ')';
         } else {
             $in = array();
             foreach ($clone as $row) {
                 $this->parameters[] = array_values(iterator_to_array($row));
                 $in[] = count($row) === 1 ? '?' : '(?)';
             }
             $condition .= ' IN (' . ($in ? implode(', ', $in) : 'NULL') . ')';
         }
     } elseif (!is_array($parameters)) {
         // where('column', 'x')
         $condition .= ' = ?';
         $this->parameters[] = $parameters;
     } else {
         // where('column', array(1, 2))
         if ($parameters) {
             $condition .= " IN (?)";
             $this->parameters[] = $parameters;
         } else {
             $condition .= " IN (NULL)";
         }
     }
     $this->where[] = $condition;
     return true;
 }
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:53,代码来源:SqlBuilder.php


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