tags:

views:

71

answers:

1

With doctrine if you execute this code

$columns = $accountTable->getColumns();
foreach ($columns as $column)
{
    print_r($column);
}

you could get for example this as result:

Array
(
    [type] => integer
    [length] => 20
    [autoincrement] => 1
    [primary] => 1
)
Array
(
    [type] => string
    [length] => 255
)

Is there a way to add custom properties to a column, so that the result would be:

Array
(
    [type] => integer
    [length] => 20
    [autoincrement] => 1
    [primary] => 1
    [customproperty] => customvalue
)
Array
(
    [type] => string
    [length] => 255
)
+2  A: 

You can do this:

$accountTable->setColumnOption('column', 'option', 'value');

If you want this to persist, you're probably best off setting this in the AccountTable class itself.

reko_t
Sweet! I can see this method in the sourcecode, but it is not documented in the Doctrine 1.2 documentation
murze
Is there a way to specify this in a yaml-file?
murze
Don't think so, but you can add custom properties in the generated models/tables.
reko_t