Propel orm 1.6,symfony 1.4嵌入I18N形式

时间:2013-01-30 00:49:54

标签: internationalization symfony1 symfony-1.4 propel symfony-forms

我使用propelorm(推进1.6)插件和symfony 1.4.20。

我有I18n的书桌,这本书与也有I18n的画廊表有关系。我填写所有书籍表格字段,添加两个图库图像,填充所有图像字段。点击保存 - 似乎一切正常:书籍字段正常,第一张和第二张图片已上传,但只有第一张图片填满了i18n字段,第二张图片所有i18n字段都是空的。什么是概率?

(没有重新声明的doSave(),save(),bind()和其他表单方法)

的模式:

  book:
    id:                   ~
    title:                { type: varchar(255), required: true }
    author:               { type: varchar(255), required: true }
    description:          { type: longvarchar, required: true }
    sortable_rank:        { type: integer, required: true }
    is_active:            { type: boolean, default: 1 }
    _indexes:
      active_sort:        [ is_active, sortable_rank ]
    _propel_behaviors:
      sortable:
        rank_column:      sortable_rank
      i18n:
        i18n_columns:     [title, description, author]
        locale_column:    culture
        locale_alias:     culture
        default_locale:   en

  book_gallery:

    id:                 ~
    book_id: { type: integer, foreignTable: book, foreignReference: id, required: true, onDelete: cascade }
    title:              { type: varchar(255), required: true }
    image:              { type: varchar(255), required: true }
    _propel_behaviors:
      i18n:
        i18n_columns:    [title]
        locale_column:   culture
        locale_alias:    culture
        default_locale:  en

书籍形式:

$languages = LanguageQuery::create()->getAllAsArray(); // returns like array('en' => 'english', ...);
$this->embedI18n(array_keys($languages));
$this->widgetSchema->setLabels($languages);
$this->embedRelation('BookGallery', array(
  'title'               => 'Application book store list',
  'item_pattern'        => 'Application book store %index%',
));

图书馆形式:

$languages = LanguageQuery::create()->getAllAsArray(); // same as in book form
$this->embedI18n(array_keys($languages));
$this->widgetSchema->setLabels($languages);

0 个答案:

没有答案