我正在使用 symfony 插件 sfDoctrineActAsTaggablePlugin 为我的模型的某些对象添加可标记行为。
我按照此处给出的说明进行操作,但是当我想在数据库中保存可标记元素时,我得到:
Unknown record property / related component "saved_tags" on "Mishidea"
Mishidea 是我想要标记的类/表的名称。这是我的 schema.yml 文件的相关部分:
Mishidea:
connection: doctrine
actAs: {Timestampable: ~ , Taggable: ~ }
tableName: mishidea
columns:
idea_id:
type: integer(4)
primary: true
autoincrement: true
idea_title:
type: string()
notnull: true
primary: false
idea_summary:
type: string()
notnull: true
primary: false
idea_description:
type: string()
notnull: true
primary: false
idea_up:
type: integer(8)
notnull: true
default: 0
primary: false
idea_down:
type: integer(8)
notnull: true
default: 0
primary: false
idea_confirmation:
type: boolean(1)
default: false
primary: false
group_id:
type: integer(4)
notnull: false
primary: false
relations:
Mishgroup:
local: group_id
foreign: group_id
type: one
Ideacomment:
local: idea_id
foreign: idea_id
type: many
Mishdocument:
local: idea_id
foreign: idea_id
type: many
RelIdeafollower:
local: idea_id
foreign: idea_id
type: many
请注意,我也尝试过:
actAs:
Timestampable: ~
Taggable: ~
和:
actAs:[Timestampable,Taggable]
代替:
actAs: {Timestampable: ~ , Taggable: ~ }
但两种选择都会产生相同的结果。
似乎可标记元素和标记表之间的关系没有建立......
有没有人知道关于可标记行为的这个特定问题的“未知记录属性/相关组件”错误?
一些帮助将不胜感激。
如果这有助于我将 Symfony 1.4 与 MySQL/InnoDB 一起使用,并且还尝试与 PostgreSQL 一起使用,结果相同。
谢谢
模糊燕鸥