私はdoctrineのSoftDeleteを使用していますが、削除時に関連レコードをSofDeleteしたいと考えています。
これが私が使用しているスキーマファイルです。
detect_relations: true
User:
actAs:
Timestampable:
SoftDelete:
Sluggable:
unique: true
fields: [name]
canUpdate: true
tableName: user
columns:
name:
type: string(50)
notnull: true
email:
type: string(50)
notnull: true
unique: true
password:
type: string(50)
notnull: true
business_id: integer
relations:
Business:
cascade: [delete]
Business:
actAs:
Timestampable:
SoftDelete:
Sluggable:
unique: true
fields: [name]
canUpdate: true
tableName: business
columns:
name:
type: string(50)
notnull: true
website: string(100)
address: string(100)
ユーザーを SoftDelete しようとすると、ビジネス テーブルから関連するレコードが削除されません (つまりdeleted_at
、ビジネス テーブルのフラグが更新されません)。deleted_at
ユーザー テーブルのフラグのみが更新されます。
私が使用しているDQLはです。
$q = Doctrine_Query::create()
->delete('Model_User u')
->where('u.id = ?', $id);
$q ->execute();
どこが間違っていますか?