views:

11

answers:

0

Hi,

I have this model definition:

#/config/doctrine/schema.yml

NewsArticle:
  options:
    (...)
  columns:
    (...)
  relations:
    Images:
      class: Image
      local: article_id
      foreign: image_id
      refClass: ImageToNewsArticle

Image:
  options:
    (...)
  columns:
    (...)
  relations:
    NewsArticles:
      class: NewsArticle
      local: image_id
      foreign: article_id
      refClass: ImageToNewsArticle

ImageToNewsArticle:
  options:
    (...)
  columns:
    image_id:
      type: integer
      primary: true
    article_id:
      type: integer
      primary: true

My goal is to have the ImageToNewsArticle objects deleted (from the database) when I delete an Image or a NewsArticle. I have to use application-level cascade, since I am on a MySQL (MyIsam) database.

Any thoughts on where I should put the cascade: [delete] attribute?

Thanks in advance,
Erland