I have a Request model which hasMany DatesTime model (each request has
one or more associated dates - its for a scheduling piece of my work's
website).  When adding or editing an existing request the DateTimes
need to be saved at the same time.  What's the best way to do this?
ie the baked contoller contains this by default:

function add() {
        if (!empty($this->data)) {
                $this->ObservationRequest->create();
                if ($this->ObservationRequest->save($this->data)) {
                        $this->Session->setFlash(__('The ObservationRequest has 
been
saved', true));                 $this->redirect(array('action'=>'index'));
                } else {
                        $this->Session->setFlash(__('The ObservationRequest 
could not be
saved. Please, try again.', true));
                }
        }
}
which seems to only save the items in the Request model...

When creating a new Request multiple dates can be added (in the view I
have some javascript to allow for dynamic form field creation such
that when submitted I'll be POSTing a dates[] array with 1 or more
dates).  How can I go about saving each of these dates to my DatesTime
model?  (I know I could just use straight SQL but it seems like that
might not be best practice)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to