managers = $managers; } /** * Adds a manager that can provide persistent object definitions. * * @param ezcPersistentDefinitionManager $manager * @return void */ public function addManager( ezcPersistentDefinitionManager $manager ) { $this->managers[] = $manager; } /** * Returns the definition of the persistent object with the class $class. * * @throws ezcPersistentDefinitionNotFoundException if no such definition can be found. * @param string $class * @return ezcPersistentDefinition */ public function fetchDefinition( $class ) { $def = null; $errors = ""; foreach ( $this->managers as $man ) { try { $def = $man->fetchDefinition( $class ); } catch ( ezcPersistentDefinitionNotFoundException $e ) { $errors = $e->getMessage() . "\n"; } if ( $def !== null ) { return $def; } } throw new ezcPersistentDefinitionNotFoundException( $class, $errors ); } } ?>