I found out how to do a Many-To-Many, Bidirectional mapping with Doctrine in PHP.
Tag Archives: doctrine
Doctrine column types
I’m using Doctrine 2.1, and the only documentation I could find for column types in Doctrine was in the 1.2 documentation. I’ve been trying to use the ‘clob’ data-type that is listed there, but haven’t had any luck getting it to work. So what I’ve done instead is to use a ‘string’ data-type and override its columnDefinition with something like this:
@Column(type="string", nullable=false, columnDefinition="TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL")
It’s a pain because that causes the database updating script below to output column changes every time it is run:
php %doctrine% orm:schema-tool:update --dump-sql > update.sql
Doctrine association mappings
Finally starting to get my head around Doctrine‘s Association Mappings. In the jsphp.co project I’m using one-to-one, one-to-may, many-to-one, and many-to-many relationships now, so I’ve got an example of everything.
Integrating Doctrine 2 with CodeIgniter 2
I was having trouble integrating the latest version of Doctrine and CodeIgniter, but luckily I found an article replete with implementation package for that: Integrating Doctrine 2 with CodeIgniter 2.
Getting started with Doctrine
I worked through the Getting Started with Doctrine guide this evening, putting my content in the Pcphpjs project. There were a few hurdles to jump over, but in the end I got the sample application working in PHP with SQLite.