【发布时间】:2011-01-14 13:42:12
【问题描述】:
我有这样的架构:
架构:
article:
id: ~
title: { type: VARCHAR, size: '255', required: true }
created_at: { type: TIMESTAMP, required: true }
updated_at: { type: TIMESTAMP, required: true }
article_data:
id: ~
article_data: { type: BLOB, required: true }
article_filename: { type: VARCHAR, size: '255'}
article_id: { type: INTEGER, required: true, foreignTable: article, foreignReference: id, onDelete: cascade }
所以,在我的文章管理模块中,我想显示 article_data 小部件,这是一个文件上传。
一切都很好。但是将上传的文件保存到服务器时,article_id 字段为空。
有没有办法获取文章的id并将其保存为article_data表的article_id?
谢谢
编辑:
我想我需要重写 saveEmbeddedForm() 方法,但我不确定我需要做什么。
有人可以帮忙写一些 saveEmbeddedForm() 的代码吗?
谢谢
【问题讨论】:
标签: symfony1 symfony-1.4 propel