\Pop\Cache\AdapterSqlite

SQLite cache adapter class

Summary

Methods
Properties
Constants
__construct()
setLifetime()
save()
load()
remove()
clear()
isExpired()
getStart()
getExpiration()
getLifetime()
setDb()
getDb()
getTable()
setTable()
delete()
query()
No public properties found
No constants found
prepare()
bindParams()
execute()
checkTable()
$lifetime
$db
$table
$sqlite
$statement
$result
$isPdo
N/A
No private methods found
No private properties found
N/A

Properties

$lifetime

$lifetime : integer

Cache lifetime

Type

integer

$db

$db : string

Cache db file

Type

string

$table

$table : string

Cache db table

Type

string

$sqlite

$sqlite : mixed

Sqlite DB object (either a PDO or Sqlite3 object)

Type

mixed

$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  $lifetime, string  $table = 'pop_cache', boolean  $pdo = false) : \Pop\Cache\Adapter\Sqlite

Constructor

Instantiate the cache db object

Parameters

string $db
integer $lifetime
string $table
boolean $pdo

Throws

\Pop\Cache\Adapter\Exception

Returns

\Pop\Cache\Adapter\Sqlite

setLifetime()

setLifetime(integer  $lifetime) : \Pop\Cache\Adapter\AbstractAdapter

Set the lifetime.

Parameters

integer $lifetime

Returns

\Pop\Cache\Adapter\AbstractAdapter

save()

save(string  $id, mixed  $value) : \Pop\Cache\Adapter\Sqlite

Save a value to cache.

Parameters

string $id
mixed $value

Returns

\Pop\Cache\Adapter\Sqlite

load()

load(string  $id) : mixed

Load a value from cache.

Parameters

string $id

Returns

mixed

remove()

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

Remove a value in cache.

Parameters

string $id

Returns

\Pop\Cache\Adapter\Sqlite

clear()

clear(boolean  $del = false) : \Pop\Cache\Adapter\Sqlite

Clear all stored values from cache.

Parameters

boolean $del

Returns

\Pop\Cache\Adapter\Sqlite

isExpired()

isExpired(string  $id) : boolean

Tell is a value is expired.

Parameters

string $id

Returns

boolean

getStart()

getStart(string  $id) : integer

Get original start timestamp of the value.

Parameters

string $id

Returns

integer

getExpiration()

getExpiration(string  $id) : integer

Get expiration timestamp of the value.

Parameters

string $id

Returns

integer

getLifetime()

getLifetime(string  $id) : integer

Get the lifetime of the value.

Parameters

string $id

Returns

integer

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