I found out how to do a Many-To-Many, Bidirectional mapping with Doctrine in PHP.
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
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.