Doctrine represents one of the best-known and performant database libraries today. It is comprised of a set of stable and highly performant libaries for database storage (Doctrine DBAL) and object mapping (Doctrine ORM). This post describes the steps needed to integrate Doctrine 2 into your project using composer. Setup using Composer First, make sure that […]
Category: Doctrine
Doctrine 2 Exception EntityManager is closed
Doctrine 2’s EntityManager class will permanently close connections upon failed transactions. Thus, further requests using these closed instances will fail with the following exception: So, make sure to check your EntityManager’s state before your actual tasks: Better, create a function called getEntityManager that takes care of this check and makes sure that you always get […]
Managing Doctrine 2 Entity Model mapping classes using YamlDriver in Zend Framework 2
This post continues my approach to integrate Doctrine 2 into Zend Framework 2 by additionally setting up YamlDriver to generate and manage Doctrine 2 Entity model mapping files. First, we need to install the YAML dependency symfony/yaml: And rebuild our project: In case you forget the install the symfony/yaml module you will get an error […]
Zend Framework 2 and Doctrine 2 ORM Integration
So, finally I’ve found time to start a new approach of migrating older Zend Framework (ZF) 1 projects to ZF2. To get most out of ZF2 and its new modular design I’ve decided to simultaneously try out the Doctrine 2 ORM module. These are the steps I’ve used to integrate Doctrine 2 into ZF2. Skeleton […]
Doctrine_Pager error “Invalid parameter number” when using “IN” in “WHERE” clause
This post is just to inform fellow users of Doctrine about a problem with Doctrine_Pager using “IN” for “WHERE” clauses. Simply put: Just don’t use it (at the moment), as it will result in the following error: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens Instead, use orWhere() for […]
Zend 1.11.6 and Doctrine 1.2
Recently, our project team spent quite some time figuring out a way to get Zend (ZF) working together with Doctrine ORM. Although there are a lot of howtos and guides out there it seems like everybody has his/her own way of merging these two frameworks. In order to get most out of Doctrine one has […]