> your definition of validate appears to differ from the frameworks. The > conclusion I was leading you towards was to always start with the code > bake gives you - and you are not.
You are right, in the previous sentence with ``validate'' I meant I needed to make sure that given id points to a record of the database. I have not taken into account the possibility of using bake because I'm working on a REST application which has nothing to do with forms of flash messages, so I decided to create each controller from scratch; however I could give it a try and see how generated controllers look like. > >> I think >> I will put that logic inside the beforeSave callback in order to keep >> controllers as simple as possible. > > Doing that doesn't make any sense, you're planning to put something in > a model that doesn't belong there. The only problem I see with what I proposed before, is that it would be not easy at all to distinguish between save operations trying to create a new record, and edit operations trying to edit an existing one; probably a new Model->update method would fix that: add controllers would invoke save to create a new object, while edit controllers would call the update method (which would fail if there is no record with given id). Do you think this solution is breaking the MVC paradigm? Regards, Matteo -- http://www.matteolandi.net/ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
