* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * * sfDoctrineSchemasConfigHandler parses the config/schemas.yml config file * * @package symfony.plugins * @subpackage sfDoctrine * @author Stephen Leavitt * @version SVN: $Id$ */ class sfDoctrineSchemasConfigHandler extends sfYamlConfigHandler { public function execute( $configFiles ) { $this->initialize(); $mappings = $this->parseYamls( $configFiles ); $data = array(); $data[] = '$manager = Doctrine_Manager::getInstance();'."\n"; foreach ( $mappings as $mapping => $schemas ) { foreach ( $schemas as $schema ) { $path = sfConfig::get( 'sf_config_dir' ) . '/doctrine/' . $schema . '.yml'; $components = array_keys( sfYaml::load( $path ) ); foreach ( $components as $component ) { $data[] = "\$manager->bindComponent('{$component}', '{$mapping}');"; } } } // compile data $retval = sprintf("