Class: Doctrine_Cache_Db

Source Location: /Doctrine/Cache/Db.php

Class Doctrine_Cache_Db

Class Overview

Implements interfaces:

  • Countable (internal interface)

Doctrine_Cache_Db

Located in /Doctrine/Cache/Db.php [line 34]

Doctrine_Cache_Driver
   |
   --Doctrine_Cache_Db
Author(s): Information Tags:
Version:  $Revision: 2258 $
Link:  www.phpdoctrine.com
Since:  1.0
License:  LGPL

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Doctrine_Cache_Driver

Doctrine_Cache_Driver::$_options

Inherited From Doctrine_Cache_Driver

Doctrine_Cache_Driver::__construct()
constructor
Doctrine_Cache_Driver::getOption()
getOption
Doctrine_Cache_Driver::setOption()
setOption

[ Top ]
Method Summary
Doctrine_Cache_Db   __construct()   constructor
mixed   contains()   Test if a cache is available or not (for the given id)
integer   count()   count returns the number of cached elements
void   createTable()   Creates the cache table.
boolean   delete()   Remove a cache record
void   deleteAll()   Removes all cache records
string   fetch()   Test if a cache is available for the given id and (if yes) return it (false else)
Doctrine_Connection   getConnection()   getConnection returns the connection object associated with this cache driver
boolean   save()   Save some string datas into a cache record

[ Top ]
Properties
Methods
Constructor __construct  [line 41]

  Doctrine_Cache_Db __construct( $options, array $_options  )

constructor

Parameters:
array   $_options:  an array of options
   $options: 

API Tags:
Access:  public


Redefinition of:
Doctrine_Cache_Driver::__construct()
constructor

[ Top ]
contains  [line 100]

  mixed contains( string $id  )

Test if a cache is available or not (for the given id)

Parameters:
string   $id:  cache id

API Tags:
Return:  false (a cache is not available) or "last modified" timestamp (int) of the available cache record
Access:  public


[ Top ]
count  [line 163]

  integer count( )

count returns the number of cached elements


API Tags:
Access:  public


Implementation of:
Countable::count

[ Top ]
createTable  [line 173]

  void createTable( )

Creates the cache table.


API Tags:
Access:  public


[ Top ]
delete  [line 138]

  boolean delete( string $id  )

Remove a cache record

Parameters:
string   $id:  cache id

API Tags:
Return:  true if no problem
Access:  public


[ Top ]
deleteAll  [line 150]

  void deleteAll( )

Removes all cache records

$return bool true on success, false on failure


API Tags:
Access:  public


[ Top ]
fetch  [line 77]

  string fetch( string $id, [boolean $testCacheValidity = true]  )

Test if a cache is available for the given id and (if yes) return it (false else)

Note : return value is always "string" (unserialization is done by the core not by the backend)

Parameters:
string   $id:  cache id
boolean   $testCacheValidity:  if set to false, the cache validity won't be tested

API Tags:
Return:  cached datas (or false)
Access:  public


[ Top ]
getConnection  [line 64]

  Doctrine_Connection getConnection( )

getConnection returns the connection object associated with this cache driver


API Tags:
Return:  connection object
Access:  public


[ Top ]
save  [line 117]

  boolean save( string $data, string $id, [int $lifeTime = false]  )

Save some string datas into a cache record

Note : $data is always saved as a string

Parameters:
string   $data:  data to cache
string   $id:  cache id
int   $lifeTime:  if != false, set a specific lifetime for this cache record (null => infinite lifeTime)

API Tags:
Return:  true if no problem
Access:  public


[ Top ]