开发者

How can custom properties be added to a column in Doctrine

开发者 https://www.devze.com 2022-12-24 10:49 出处:网络
With doctrine if you execute this code $columns = $accountTable->getColumns(); foreach ($columns as $column)

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

精彩评论

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