ezcPersistentDefinition) */ private $cache = array(); /** * Constructs a new definition cache. * * @param ezcPersistentDefinitionManager $manager */ public function __construct( ezcPersistentDefinitionManager $manager ) { $this->manager = $manager; } /** * Returns the definition of the persistent object with the class $class. * * If a definition has been requested already the definition will be served from * the cache. * * @throws ezcPersistentDefinitionNotFoundException if no such definition can be found. * @param string $class * @return ezcPersistentDefinition */ public function fetchDefinition( $class ) { if ( isset( $this->cache[$class] ) ) { return $this->cache[$class]; } $def = $this->manager->fetchDefinition( $class ); // cache it $this->cache[$class] = $def; return $def; } } ?>