CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 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

Namespaces

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ConnectionManager
  • ConnectionRegistry
  • FactoryLocator
  • Paginator
  • QueryCacher
  • ResultSetDecorator
  • RulesChecker

Interfaces

  • ConnectionInterface
  • EntityInterface
  • FixtureInterface
  • InvalidPropertyInterface
  • PaginatorInterface
  • QueryInterface
  • RepositoryInterface
  • ResultSetInterface
  • SchemaInterface
  • TableSchemaInterface

Traits

  • EntityTrait
  • ModelAwareTrait
  • QueryTrait
  • RulesAwareTrait

Class QueryCacher

Handles caching queries and loading results from the cache.

Used by Cake\Datasource\QueryTrait internally.

Namespace: Cake\Datasource
See: \Cake\Datasource\QueryTrait::cache() for the public interface.
Location: Datasource/QueryCacher.php

Properties summary

  • $_config protected
    string|Cake\Cache\CacheEngine
    Config for cache engine.
  • $_key protected
    string|callable
    The key or function to generate a key.

Method Summary

  • __construct() public
    Constructor.
  • _resolveCacher() protected
    Get the cache engine.
  • _resolveKey() protected
    Get/generate the cache key.
  • fetch() public
    Load the cached results from the cache or run the query.
  • store() public
    Store the result set into the cache.

Method Detail

__construct() public ¶

__construct( string|Closure $key , string|Cake\Cache\CacheEngine $config )

Constructor.

Parameters
string|Closure $key
The key or function to generate a key.
string|Cake\Cache\CacheEngine $config
The cache config name or cache engine instance.
Throws
RuntimeException

_resolveCacher() protected ¶

_resolveCacher( )

Get the cache engine.

Returns
Cake\Cache\CacheEngine

_resolveKey() protected ¶

_resolveKey( object $query )

Get/generate the cache key.

Parameters
object $query
The query to generate a key for.
Returns
string
Throws
RuntimeException

fetch() public ¶

fetch( object $query )

Load the cached results from the cache or run the query.

Parameters
object $query
The query the cache read is for.
Returns
Cake\Datasource\ResultSetInterface|null
Either the cached results or null.

store() public ¶

store( object $query , Traversable $results )

Store the result set into the cache.

Parameters
object $query
The query the cache read is for.
Traversable $results
The result set to store.
Returns
boolean
True if the data was successfully cached, false on failure

Properties detail

$_config ¶

protected string|Cake\Cache\CacheEngine

Config for cache engine.

$_key ¶

protected string|callable

The key or function to generate a key.

Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs