Reputation: 1
i worked with doctrine and zend framework 1 before and installed doctrine as follows:
add below function in bootstrap.php file protected function _initDoctrine() { require_once 'Doctrine/Doctrine.php'; $this->getApplication() ->getAutoloader() ->pushAutoloader(array('Doctrine','autoload'),'Doctrine');
$manager=Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
$config=$this->getOption('Doctrine');
$conn=Doctrine_Manager::connection($config['dsn'],'doctrine');
return $conn;
}
then i create an object from my generated models and use it to add,update or delete records in database but when i tried to use zend framework 2 i failed to install and use doctrine with it and when google it i found something called entity and some other points i didn't know so please i want to know how to install doctrine with zend 2 with same idea like i installed before and use it with my zend framework 2 projects. thanks
Upvotes: 0
Views: 168
Reputation: 947
If you want to use Doctrine2 with ZF2, you can include DoctrineModule and DoctrineORMModule for the ORM part in your composer.json
.
They are very usefull and very well documented
Upvotes: 2