开发者

How can custom properties be added to a column in Doctrine

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] => s开发者_运维知识库tring
    [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
)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜