Attching a Behaviour to a dynamically created table in Doctrine
Posted
by Cesare Contini
on Stack Overflow
See other posts from Stack Overflow
or by Cesare Contini
Published on 2010-03-16T14:08:59Z
Indexed on
2010/03/18
0:31 UTC
Read the original article
Hit count: 422
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?
© Stack Overflow or respective owner