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