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


PHP Connection::getCache方法代碼示例

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


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

示例1: getPreviousAccessed

 /**
  * Loads cache of previous accessed columns and returns it
  *
  * @internal
  * @return array|false
  */
 public function getPreviousAccessed()
 {
     $cache = $this->connection->getCache();
     if ($this->rows === null && $cache && !is_string($this->prevAccessed)) {
         $this->accessed = $this->prevAccessed = $cache->load(array(__CLASS__, $this->name, $this->sqlBuilder->getConditions()));
     }
     return $this->prevAccessed;
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:14,代碼來源:Selection.php

示例2: __construct

 /**
  * Creates filtered table representation.
  * @param  string  database table name
  * @param  Nette\Database\Connection
  */
 public function __construct($table, Nette\Database\Connection $connection)
 {
     $this->name = $table;
     $this->connection = $connection;
     $reflection = $connection->getDatabaseReflection();
     $this->primary = $reflection->getPrimary($table);
     $this->sqlBuilder = new SqlBuilder($table, $connection, $reflection);
     $this->cache = $connection->getCache();
 }
開發者ID:genextwebs,項目名稱:dropbox-sample,代碼行數:14,代碼來源:Selection.php

示例3: getSql

 /**
  * Returns SQL query.
  * @return string
  */
 public function getSql()
 {
     $join = $this->createJoins(implode(',', $this->conditions), TRUE) + $this->createJoins(implode(',', $this->select) . ",{$this->group},{$this->having}," . implode(',', $this->order));
     $cache = $this->connection->getCache();
     if ($this->rows === NULL && $cache && !is_string($this->prevAccessed)) {
         $this->accessed = $this->prevAccessed = $cache->load(array(__CLASS__, $this->name, $this->conditions));
     }
     $prefix = $join ? "{$this->delimitedName}." : '';
     if ($this->select) {
         $cols = $this->removeExtraTables($this->tryDelimite(implode(', ', $this->select)));
     } elseif ($this->prevAccessed) {
         $cols = $prefix . implode(', ' . $prefix, array_map(array($this->connection->getSupplementalDriver(), 'delimite'), array_keys($this->prevAccessed)));
     } else {
         $cols = $prefix . '*';
     }
     return "SELECT{$this->topString()} {$cols} FROM {$this->delimitedName}" . implode($join) . $this->whereString();
 }
開發者ID:exesek,項目名稱:nette20login,代碼行數:21,代碼來源:Selection.php

示例4: saveCacheState

 protected function saveCacheState()
 {
     if ($this->observeCache && ($cache = $this->connection->getCache()) && !$this->sqlBuilder->getSelect() && $this->accessed != $this->prevAccessed) {
         $cache->save(array(__CLASS__, $this->name, $this->sqlBuilder->getConditions()), $this->accessed);
     }
 }
開發者ID:BroukPytlik,項目名稱:agility,代碼行數:6,代碼來源:Selection.php


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