Attching a Behaviour to a dynamically created table in Doctrine
- by Cesare Contini
How do I programmatically attach a Doctrine Behaviour programmatically to a table dynamically created through $conn->export->createTable('MyTable', $definition)?
For example, if I have the following code:
$definition = array(
'id' => array(
'type' => 'integer',
'primary' => true,
'autoincrement' => true
),
'name' => array(
'type' => 'string',
'length' => 255
)
);
$conn->export->createTable('MyTable', $definition) ;
At this point I would need to attach a doctrine typical behaviour like Timestampable or Versionable to the newly created 'MyTable' table. Is it possible at all?