Monday, November 3, 2008

Re: Creating Multiple model objects from the same method

You can use saveAll, at least that's what i've done for something
similar.
Here are 2 tutorials on how to do that:

http://teknoid.wordpress.com/2008/08/01/practical-use-of-saveall-part-1-working-with-multiple-models/
http://teknoid.wordpress.com/2008/08/04/practical-use-of-saveall-part-2-notes-and-tips/

On Nov 4, 1:43 am, Lagg <l.e.wilkow...@gmail.com> wrote:
> I apologize if my subject is confusing and I doubly apologize if this
> issue has been addressed before.
>
> I have two tables.
>
> Projects have many Tasks
>
> Tasks have 1 project
>
> I would like set some default Tasks every time I create a new Project.
> (Such as Clean, Wash, Wax, etc).
>
> How would I do this? Would I make some sort of model method that does
> raw sql inserts? Is there a way to do "$this->Project->Task-
>
> >save( Magic-ProjectID-from-somewhere, "Clean" )  "?
>
> Thanks for your time.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: