Silla.IO API
  • Namespace
  • Class
  • Tree
  • Todo
  • Download

Namespaces

  • App
    • Controllers
  • CMS
    • Controllers
    • Helpers
    • Models
  • Configurations
    • CI
    • Development
    • Production
    • Staging
  • Core
    • Base
    • CLI
      • Cache
      • DB
    • Helpers
    • Modules
      • Cache
        • Adapters
        • Interfaces
      • Crypt
      • DB
        • Adapters
        • Decorators
          • Interfaces
        • Features
          • Paginator
        • Interfaces
      • Registry
      • Render
        • Adapters
        • Interfaces
      • Router
      • Session
        • Adapters
        • Interfaces
  • None
  • Tasks
    • DB

Classes

  • DB
  • DbCache
  • Migration
  • Observer
  • Query

Class DbCache

DbCache Class Definition. Singleton class for handling the database cache.

Final
Namespace: Core\Modules\DB
Located at modules/db/dbcache.php

Methods summary

public
# __construct( array $dsn )

Initialize DB Cache.

Initialize DB Cache.

Parameters

$dsn
Data source name.

Uses

Core\Modules\DB\DbCache::setSchema()
public
# __clone( )

Cloning of DbCache is disallowed.

Cloning of DbCache is disallowed.

public
# __set( string $attr, mixed $val )

Set method.

Set method.

Parameters

$attr
Attribute name.
$val
Attribute value.
public mixed
# __get( string $attr )

Get method.

Get method.

Parameters

$attr
Attribute name.

Returns

mixed
public
# setCache( string $table, string $query, array $result )

Cache a query and its result.

Cache a query and its result.

Parameters

$table
Table name.
$query
SQL query.
$result
Result array.
public array
# getCache( string $table, string $query = null )

Get the result of a cached query, or return the whole cache.

Get the result of a cached query, or return the whole cache.

Parameters

$table
Table name.
$query
Query string(optional).

Returns

array
public
# clearCache( string $table )

Clears the cache for a given table.

Clears the cache for a given table.

Parameters

$table
Table name.
public boolean
# getTable( string $name )

Get the state of a table.

Get the state of a table.

Parameters

$name
Name of the table.

Returns

boolean
public object
# getStatement( string $query )

Get a database statement.

Get a database statement.

Parameters

$query
It's used for a key.

Returns

object
private
# setSchema( string $table, array $value )

Set a table schema.

Set a table schema.

Parameters

$table
Name of the table.
$value
Schema data.

Used by

Core\Modules\DB\DbCache::__construct()
public array
# getSchema( string $table )

Get the table schema.

Get the table schema.

Parameters

$table
Name of the table.

Returns

array
private array
# getSchemaMeta( string $tableName )

Get table meta information from cache or extract it, if missing.

Get table meta information from cache or extract it, if missing.

Parameters

$tableName
Name of the table.

Returns

array

Uses

Core\Cache()
Core\Modules\DB\DbCache::extractSchemaMeta()
private array
# extractSchemaMeta( string $tableName )

Retrieve meta information about supplied database table.

Retrieve meta information about supplied database table.

Parameters

$tableName
Name of the table.

Returns

array

Throws

LogicException
Error extracting schema meta information.

Uses

Core\DB()
Core\Modules\DB\DbCache::associateType()

Used by

Core\Modules\DB\DbCache::getSchemaMeta()
private string
# associateType( string $type )

Associate the field type with specific value used in the queries.

Associate the field type with specific value used in the queries.

Parameters

$type
Field type.

Returns

string

Used by

Core\Modules\DB\DbCache::extractSchemaMeta()

Properties summary

private boolean $hasSchema

Whether there is a schema or not.

Whether there is a schema or not.

# false
public array $cache

Stores the queries cache.

Stores the queries cache.

# array()
private array $schema

Stores tables schema.

Stores tables schema.

# array()
private array $tables

Stores the state of the tables(if the table has been changed, after cached query).

Stores the state of the tables(if the table has been changed, after cached query).

# array()
private array $statements

Stores the prepared database statements.

Stores the prepared database statements.

# array()
private array $dsn

Data source name.

Data source name.

#
Silla.IO API API documentation generated by ApiGen