\Pop\Cache\AdapterSqlite

SQLite cache adapter class

Summary

Methods
Properties
Constants
__construct()
setTtl()
getTtl()
getItemTtl()
saveItem()
getItem()
hasItem()
deleteItem()
clear()
destroy()
setDb()
getDb()
getTable()
setTable()
query()
No public properties found
No constants found
prepare()
bindParams()
execute()
checkTable()
$ttl
$db
$table
$sqlite
$statement
$result
$isPdo
N/A
No private methods found
No private properties found
N/A

Properties

$ttl

$ttl : integer

Global time-to-live

Type

integer

$db

$db : string

Cache db file

Type

string

$table

$table : string

Cache db table

Type

string

$sqlite

$sqlite : \PDO|\SQLite3

Sqlite DB object

Type

\PDO|\SQLite3

$statement

$statement : mixed

Sqlite DB statement object (either a PDOStatement or SQLite3Stmt object)

Type

mixed

$result

$result : resource

Database results

Type

resource

$isPdo

$isPdo : boolean

PDO flag

Type

boolean

Methods

__construct()

__construct(string  $db, integer  $ttl, string  $table = 'pop_cache', boolean  $pdo = false) 

Constructor

Instantiate the cache db object

Parameters

string $db
integer $ttl
string $table
boolean $pdo

Throws

\Pop\Cache\Adapter\Exception

setTtl()

setTtl(integer  $ttl) : \Pop\Cache\Adapter\AbstractAdapter

Set the global time-to-live for the cache adapter

Parameters

integer $ttl

Returns

\Pop\Cache\Adapter\AbstractAdapter

getTtl()

getTtl() : integer

Get the global time-to-live for the cache object

Returns

integer

getItemTtl()

getItemTtl(string  $id) : integer

Get the time-to-live for an item in cache

Parameters

string $id

Returns

integer

saveItem()

saveItem(string  $id, mixed  $value, integer  $ttl = null) : \Pop\Cache\Adapter\Sqlite

Save an item to cache

Parameters

string $id
mixed $value
integer $ttl

Returns

\Pop\Cache\Adapter\Sqlite

getItem()

getItem(string  $id) : mixed

Get an item from cache

Parameters

string $id

Returns

mixed

hasItem()

hasItem(string  $id) : boolean

Determine if the item exist in cache

Parameters

string $id

Returns

boolean

deleteItem()

deleteItem(string  $id) : \Pop\Cache\Adapter\Sqlite

Delete a value in cache

Parameters

string $id

Returns

\Pop\Cache\Adapter\Sqlite

setDb()

setDb(string  $db) : \Pop\Cache\Adapter\Sqlite

Set the current cache db file.

Parameters

string $db

Throws

\Pop\Cache\Adapter\Exception

Returns

\Pop\Cache\Adapter\Sqlite

getDb()

getDb() : string

Get the current cache db file.

Returns

string

getTable()

getTable() : string

Get the current cache db table.

Returns

string

setTable()

setTable(string  $table) : \Pop\Cache\Adapter\Sqlite

Set the cache db table

Parameters

string $table

Returns

\Pop\Cache\Adapter\Sqlite

query()

query(string  $sql) : void

Execute the SQL query

Parameters

string $sql

Throws

\Pop\Cache\Adapter\Exception

prepare()

prepare(string  $sql) : \Pop\Cache\Adapter\Sqlite

Prepare a SQL query

Parameters

string $sql

Returns

\Pop\Cache\Adapter\Sqlite

bindParams()

bindParams(array  $params) : \Pop\Cache\Adapter\Sqlite

Bind parameters to for a prepared SQL query

Parameters

array $params

Returns

\Pop\Cache\Adapter\Sqlite

execute()

execute() : void

Execute the prepared SQL query

Throws

\Pop\Cache\Adapter\Exception

checkTable()

checkTable() : void

Check if cache table exists