开发者

How to get the translated fields of a doctrine table

I'm using I18n-behaviour to store translated values.

$i18n = new Doctrine_Template_I18n(array('fields' => array('title', 'text')));
$this->actAs($i18n);

With $tableFields = Doctrine_Core::getTable($componentName)->getFieldNames(); I can get开发者_运维技巧 a array with all the fieldnames of the doctrine component. However the fields that are being translated through the I18N-behaviour are not present in this array.

My question: how can i get the names of translated fields?


$table = Doctrine_Core::getTable('Page');
$template = $table->getTemplate('I18n');
$options = $template->getOptions();
$translated_fields = $options['fields'];
var_dump($translated_fields);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜