php - Related records are insert everytime -
i have table articles , other tables related table of images. saving image start calculating , saving related thumbnails done in model of image (presave). saving article start saving images starts thumbnails process again. , don't know why ...
when save article want save relation. saving thumbnails hard process causing timeout , using resources.
how do that?
here part of schema reduced important aspects:
image: columns: # ... relations: flats: class: flat refclass: flatimage foreignalias: images articles: class: article refclass: articleimage foreignalias: articles thumbnail: columns: # ... relations: sourceimage: class: image local: image_id ondelete: cascade foreignalias: thumbnails when need other parts of code, please comment.
see "cascade_saves" here databases.yml file. should work.
all: doctrine: class: sfdoctrinedatabase param: dsn: mysql:host=localhost;dbname=mydatabase username: ### password: ### encoding: utf8 attributes: cascade_saves: false
Comments
Post a Comment