0
如何從「多」表記錄中獲取對象?symfony 1.4:如何從關係表中獲取記錄
我有rsObjectComments
的列表,我需要取rsObjects
。
例如:
的schema.yml:
rsObject:
actAs:
Timestampable: ~
Sluggable:
fields: [name]
columns:
name: { type: string(255), notnull: true, unique: true }
description: { type: string(6000), notnull: true }
relations:
rsObjectComments:
class: rsObjectComments
local: id
foreign: rsobject_id
type: many
foreignAlias: Comments
rsObjectComments:
actAs:
Timestampable: ~
columns:
rsobject_id: { type: integer, notnull: true }
fromname: { type: string(100), notnull:true }
fromemail: { type: string(100), notnull:true }
comments: { type: string(1000), notnull:true }
is_public: { type: boolean, notnull: true, default: 1 }
relations:
rsObject: { onDelete: CASCADE, local: rsobject_id, foreign: id, foreignAlias: rsObjectCommentsAlias }