开发者

zend + doctrine 2 doctrine manager, where is it?

i see everyone开发者_如何学C using this:

 Doctrine_Manager::getInstance()

when i do this, its error is:

Class 'Doctrine_Manager' not found

how do i load this ?so that i can start get instances from doctrine manager?

i want to load this:

$con = Doctrine_Manager::getInstance()->connection();
$st = $con->execute("...............");


$result = $st->fetchAll();

where can autoload this , so i can call the getInstance() function from anywhere?

thanks...


Doctrine_Manager is part of version 1.2, not 2. If you are actually using 1.2, you need to let the autoloader know to load classes under the Doctrine_ prefix.

To do so, add this to your application configuration file...

autoloaderNamespaces.Doctrine = "Doctrine_"

You also need to ensure the doctrine classes can be found on the include path. If they aren't in your "library" folder or otherwise part of the include_path directive, add this...

includePaths.Doctrine = "/path/to/Doctrine-1.2/lib"


I think you might be looking for the EntityManager?

If so, here you can find a tutorial how to configure.

Also there is a library call Bisna for integrating ZF+Doctrine2, here is a good tutorial video for configuring it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜