# SmartDaoWorker Class Reference
[Root classes for building DAO hierarchies]

Transparent caching DAO worker. More...

Inheritance diagram for SmartDaoWorker:
[legend]

List of all members.

## Public Member Functions

| __construct (GenericDAO $dao)
| uncacheLists ()
| uncachers

## Protected Member Functions

| cacheByQuery (SelectQuery $query, $object, $expires=Cache::EXPIRES_FOREVER)
| cachers
| cacheListByQuery (SelectQuery $query, $array)

## Private Attributes

| $indexKey = null
| gentlyGetByKey ($key)
| internal helpers
| syncMap ($objectKey)
| checkMap ($objectKey)

## Detailed Description

Transparent caching DAO worker.

See also:
  CommonDaoWorker for manual-caching one.
  VoodooDaoWorker for greedy though non-blocking brother.

Definition at line 20 of file SmartDaoWorker.class.php.

## Constructor & Destructor Documentation

SmartDaoWorker::__construct | ( | GenericDAO $ | dao | ) |

Reimplemented from BaseDaoWorker.

Definition at line 24 of file SmartDaoWorker.class.php.

## Member Function Documentation

SmartDaoWorker::cacheByQuery | ( | SelectQuery $ | query,
|  | $ | object,
|  | $ | expires = `Cache::EXPIRES_FOREVER` |
| ) |  |  | `[protected]`

cachers

Reimplemented from CommonDaoWorker.

Definition at line 36 of file SmartDaoWorker.class.php.

References QueryIdentification::getId(), TransparentDaoWorker::keyToInt(), BaseDaoWorker::makeQueryKey(), Cache::me(), SemaphorePool::me(), and syncMap().

Here is the call graph for this function:

SmartDaoWorker::cacheListByQuery | ( | SelectQuery $ | query,
|  | $ | array |
| ) |  |  | `[protected]`

Reimplemented from CommonDaoWorker.

Definition at line 62 of file SmartDaoWorker.class.php.

References TransparentDaoWorker::cacheById(), Cache::EXPIRES_FOREVER, Assert::isArray(), Assert::isTrue(), TransparentDaoWorker::keyToInt(), BaseDaoWorker::makeQueryKey(), SemaphorePool::me(), Cache::me(), Cache::NOT_FOUND, and syncMap().

Here is the call graph for this function:

SmartDaoWorker::checkMap | ( | $ | objectKey | ) | `[private]`

Definition at line 157 of file SmartDaoWorker.class.php.

References TransparentDaoWorker::keyToInt(), Cache::me(), and SemaphorePool::me().

Referenced by gentlyGetByKey().

Here is the call graph for this function:

SmartDaoWorker::gentlyGetByKey | ( | $ | key | ) | `[protected]`

internal helpers

Reimplemented from TransparentDaoWorker.

Definition at line 129 of file SmartDaoWorker.class.php.

References checkMap(), and Cache::me().

Here is the call graph for this function:

SmartDaoWorker::syncMap | ( | $ | objectKey | ) | `[private]`

Definition at line 142 of file SmartDaoWorker.class.php.

References Cache::EXPIRES_FOREVER, and Cache::me().

Referenced by cacheByQuery(), and cacheListByQuery().

Here is the call graph for this function:

SmartDaoWorker::uncacheLists | ( |  | ) |

uncachers

Reimplemented from CommonDaoWorker.

Definition at line 100 of file SmartDaoWorker.class.php.

References TransparentDaoWorker::keyToInt(), SemaphorePool::me(), and Cache::me().

Here is the call graph for this function:

## Member Data Documentation

SmartDaoWorker::$indexKey = null`[private]`

Definition at line 22 of file SmartDaoWorker.class.php.

The documentation for this class was generated from the following file:

- main/DAOs/Workers/SmartDaoWorker.class.php