我有一个数据库设计案例,我很好奇 Doctrine ORM 是否支持开箱即用。
产品:
列:
id:{type:integer,primary:true,autoincrement:true}
type_id:{type:integer,notnull:true}
brand_id:{type:integer,notnull:true}
关系:
ProductType:
class:ProductType
local: type_id
国外:id
品牌:
类:品牌
本地:brand_id
国外:id
ProductType :
actAs :
I18n:
fields: { name }
columns :
id: {type: integer, primary: true, autoincrement: true }
name: { type: string(255), notnull: true }
品牌:
actAs:
I18n:
字段:{名称}
列:
id:{类型:整数,主要:真,自动增量:真}
名称:{类型:字符串(255),notnull:真}
我想 slugify Products 表,即。产品将通过它们的蛞蝓到达。但是,正如您所见,brand 表和 productype 表都有 i18n 行为。而且,产品没有名称。产品的 slug 将是:“Brand.name - ProductType.name”,并随服务的语言而变化。
对于这种情况,无论如何我可以使用 Doctrine 的 Sluggable 行为来自动对我的产品进行 sluggify。还是我必须手动管理它?
顺便说一下,我的环境配置是:
Doctrine Version : 1.2
Symfony : 1.4.1
谢谢