CakePHP
  • 文档
    • 图书
    • API
    • 视频
    • 报告安全问题
    • 隐私政策
    • 徽标和商标
  • 商业解决方案
  • 周边商品
  • 公路旅行
  • 团队
  • 社区
    • 社区
    • 参与
    • 问题 (Github)
    • 烘焙坊
    • 特色资源
    • 培训
    • 聚会
    • 我的 CakePHP
    • CakeFest
    • 新闻通讯
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • 帮助和支持
    • 论坛
    • Stack Overflow
    • IRC
    • Slack
    • 付费支持
CakePHP

C CakePHP 5.1 Chiffon API

  • 项目
    • CakePHP
      • CakePHP
      • Chronos
      • Elastic Search
      • 队列
  • 版本
    • 5.1
      • 5.1
      • 5.0
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

命名空间

  • 全局
  • Cake
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
      • Driver
      • Exception
      • Expression
      • Log
      • Query
      • Retry
      • Schema
      • Statement
      • Type
    • Datasource
    • Error
    • Event
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • TestSuite
    • Utility
    • Validation
    • View

类 CachedCollection

装饰一个模式集合并添加缓存

命名空间: Cake\Database\Schema

属性摘要

  • $cacher protected
    Psr\SimpleCache\CacheInterface

    缓存器实例。

  • $collection protected
    Cake\Database\Schema\CollectionInterface

    装饰的模式集合

  • $prefix protected
    string

    缓存键的前缀

方法摘要

  • __construct() public

    构造函数。

  • cacheKey() public

    获取给定名称的缓存键。

  • describe() public

    获取表的列元数据。

  • getCacher() public

    获取缓存器。

  • listTables() public

    获取当前连接中可用的表列表。

  • listTablesWithoutViews() public

    获取当前连接中可用的表列表。这将排除模式中的任何视图。

  • setCacher() public

    设置缓存器。

方法详情

__construct() ¶ public

__construct(Cake\Database\Schema\CollectionInterface $collection, string $prefix, Psr\SimpleCache\CacheInterface $cacher)

构造函数。

参数
Cake\Database\Schema\CollectionInterface $collection

要包装的集合。

string $prefix

要使用的缓存键前缀。通常是连接名称。

Psr\SimpleCache\CacheInterface $cacher

缓存器实例。

cacheKey() ¶ public

cacheKey(string $name): string

获取给定名称的缓存键。

参数
string $name

获取缓存键的名称。

返回值
string

describe() ¶ public

describe(string $name, array<string, mixed> $options = []): Cake\Database\Schema\TableSchemaInterface

获取表的列元数据。

如果 Connection 配置选项中存在 cacheMetadata 键,则将应用缓存。默认值为 _cakemodel,如果为真。

选项

  • forceRefresh - 设置为 true 以强制重建缓存的元数据。默认为 false。
参数
string $name
array<string, mixed> $options optional
返回值
Cake\Database\Schema\TableSchemaInterface

getCacher() ¶ public

getCacher(): Psr\SimpleCache\CacheInterface

获取缓存器。

返回值
Psr\SimpleCache\CacheInterface

listTables() ¶ public

listTables(): list<string>

获取当前连接中可用的表列表。

返回值
list<string>

listTablesWithoutViews() ¶ public

listTablesWithoutViews(): array

获取当前连接中可用的表列表。这将排除模式中的任何视图。

返回值
array

setCacher() ¶ public

setCacher(Psr\SimpleCache\CacheInterface $cacher): $this

设置缓存器。

参数
Psr\SimpleCache\CacheInterface $cacher

缓存器对象

返回值
$this

属性详情

$cacher ¶ protected

缓存器实例。

Type
Psr\SimpleCache\CacheInterface

$collection ¶ protected

装饰的模式集合

Type
Cake\Database\Schema\CollectionInterface

$prefix ¶ protected

缓存键的前缀

Type
string
OpenHub
Pingping
Linode
  • 商业解决方案
  • 展示
  • 文档
  • 图书
  • API
  • 视频
  • 报告安全问题
  • 隐私政策
  • 徽标和商标
  • 社区
  • 参与
  • 问题 (Github)
  • 烘焙坊
  • 特色资源
  • 培训
  • 聚会
  • 我的 CakePHP
  • CakeFest
  • 新闻通讯
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • 帮助和支持
  • 论坛
  • Stack Overflow
  • IRC
  • Slack
  • 付费支持

使用 CakePHP API 文档 生成