ConnectionCache

singleton which is used to manage DataAccess objects

see

ConnectionFactory DataAccess

Summary
singleton which is used to manage DataAccess objects
ArrayObject which holds the DataAccess objects
ConnectionCache instance
initializes cache
creates and returns instance of ConnectionCache if instance does not exist, otherwise returns instance if instance already exists
creates/overwrites a DataAccess entry in the cache
removes an entry from the cache
creates/overwrites a DataAccess entry in the cache
verifies if an entry is valid based on its key

properties

cache

private $cache

ArrayObject which holds the DataAccess objects

instance

private static $instance

ConnectionCache instance

methods

__construct

private function __construct()

initializes cache

getInstance

public static function getInstance()

creates and returns instance of ConnectionCache if instance does not exist, otherwise returns instance if instance already exists

returns

instance of ConnectionCache

setEntry

public function setEntry($key,
$conn)

creates/overwrites a DataAccess entry in the cache

parameters

keystring defining which entry to set
connDataAccess object to set

see

getEntry

removeEntry

public function removeEntry($conn)

removes an entry from the cache

parameters

connDataAccess object to remove

returns

boolean indicating if removal was successful

getEntry

public function getEntry($key)

creates/overwrites a DataAccess entry in the cache

parameters

keystring defining which entry to get

returns

DataAccess object

see

setEntry

isEntry

public function isEntry($key)

verifies if an entry is valid based on its key

parameters

keystring defining which entry to verify

returns

boolean indicating if key is in cache

private $cache
ArrayObject which holds the DataAccess objects
private static $instance
ConnectionCache instance
private function __construct()
initializes cache
public static function getInstance()
creates and returns instance of ConnectionCache if instance does not exist, otherwise returns instance if instance already exists
public function setEntry($key,
$conn)
creates/overwrites a DataAccess entry in the cache
public function removeEntry($conn)
removes an entry from the cache
public function getEntry($key)
creates/overwrites a DataAccess entry in the cache
public function isEntry($key)
verifies if an entry is valid based on its key