* @license GPLv2 * @package generis * @deprecated use PersistenceManager */ class common_persistence_Manager extends PersistenceManager { /** @deprecated */ const SERVICE_KEY = 'generis/persistences'; /** * @return common_persistence_Manager * @deprecated */ protected static function getDefaultManager() { try { $manager = ServiceManager::getServiceManager()->get(self::SERVICE_ID); } catch (ServiceNotFoundException $ex) { $manager = new self([ self::OPTION_PERSISTENCES => [] ]); $manager->setServiceManager(ServiceManager::getServiceManager()); } return $manager; } /** * * @param string $persistenceId * @return common_persistence_Persistence * @deprecated */ public static function getPersistence($persistenceId) { return self::getDefaultManager()->getPersistenceById($persistenceId); } /** * Add a new persistence to the system * * @param string $persistenceId * @param array $persistenceConf * @deprecated */ public static function addPersistence($persistenceId, array $persistenceConf) { $manager = self::getDefaultManager(); $manager->registerPersistence($persistenceId, $persistenceConf); $manager->getServiceManager()->register(self::SERVICE_ID, $manager); } }