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