프로젝트에서 Doctrine 1.2를 사용하고 있습니다.Doctrine cascade : [delete] 관련 객체의 delete() 메소드를 호출하지 않습니다.
Campaign:
tableName: campaign
actAs:
Timestampable:
created:
name: created_datetime
type: timestamp
format: Y-m-d H:i:s
updated:
disabled: true
columns:
id:
type: integer(9)
fixed: false
unsigned: false
primary: true
autoincrement: true
...
relations:
CampaignImages:
local: id
foreign: campaign_id
type: many
cascade: [delete]
...
CampaignImages:
tableName: campaign_images
columns:
id:
type: integer(9)
fixed: false
unsigned: false
primary: true
autoincrement: true
campaign_id:
type: integer(9)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
...
내가 정의한 CampaignImages이 :() 메소드를 삭제하고 거기에 몇 가지 디버깅 코드를 삽입하지만, 캠페인 :: 삭제할 때 호출된다()가 실행되지 않습니다 다음 schema.yml 파일 파일이 포함되어 있습니다.
계단식이 아니십니까? [delete]는 이러한 이유로 정확하게 의미합니까? 레코드 삭제시 CampaignImage와 연결된 이미지 파일을 삭제해야하므로 데이터베이스 수준 단계를 사용하고 싶지 않습니다.
감사 쿠바했던이
을 넣어 내가 다른 방법으로 해결했다, 난 그냥 찾고 있었다 그. – fest