Related records are insert everytime

I have a table where articles and other tables are related to a table of images. Saving an image start calculating and saving the related thumbnails which is done in the model of the image (preSave). Saving an article start saving the images which starts the thumbnails process again. And I don't know why ...

When I save an article I only want to save the relation. Saving thumbnails is a hard process often causing a timeout and using too much resources.

How do I do that?

Here is a part of my schema reduced to the important aspects:

    # ...
      class: Flat
      refClass: FlatImage
      foreignAlias: Images
      class: Article
      refClass: ArticleImage
      foreignAlias: Articles

    # ...
      class:        Image
      local:        image_id
      onDelete:     CASCADE
      foreignAlias: Thumbnails

When you need other parts of code, please comment.


See the "cascade_saves" here for your databases.yml file. That should work.

    class: sfDoctrineDatabase
      dsn:               mysql:host=localhost;dbname=mydatabase
      username:          ###
      password:          ###
      encoding:          utf8
         cascade_saves: false

Need Your Help

Jquery, while, each: how to test if all :selected is not 0

javascript jquery validation while-loop each

I have a form that has a few select dropdowns, and I want to make sure that at least one has the default of '0' changed to something else. However, I can't get my mind around how to do it. I've tried

how can i read data from csv file and store in binary tree and write multiple file in perl

perl csv binary-tree

I have CSV file which have more than 10 lakh data. I want to use binary::tree for less memory uses.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.