I\'m interested in using Doctrine as an ORM for a new Zend Framework app I\'m writing. I\'m trying to figure out the best way to integrate it as straightforward as possible.
I wrote a Resource Bootstrapper for Doctrine and Zend Framework a few weeks ago and turned it all into a small wrapper framework, cause I think ZF and Doctrine are a great team. You can read the article here: http://coffeecoders.de/2009/06/using-the-zend-framework-18-bootstrapper-and-doctrine-110/
It is fully configurable via the Bootstrap resource configurations (example included, too). Unfortunately Doctrine searches for Models in the model folder with the same classname as the filename (which doesn't match the ZF naming scheme) so it was actually not possible to get rid of registering the Doctrine Autoloader. The resource Loader looks like this:
getOptions();
foreach($options as $key => $value)
{
if($key != 'connection' && $key != 'directory')
$manager->setAttribute($key, $value);
}
if(empty($options['connection']))
throw new Exception("No database connection string provided!");
Doctrine_Manager::connection($options['connection']);
if(empty($options['directory']))
$dir = './models';
else
$dir = $options['directory'];
Doctrine::loadModels(realpath($dir));
return $manager;
}
}