i'm having a bit of difficulty getting my head around saving records
with HABM.
i'm am trying to dump a whole lot of data simultaneously.
if i do it manually i can get it to work.
for example:
i have an artists table. and a last_update table.
then this works fine:
$artist = $this->Artist->findById($id);
$field_to_update = "band_members_last_updated";
$this->data['LastUpdate']['id'] = $artist['LastUpdate']['id'];
$this->data['LastUpdate']['artist_id'] = $artist['id'];
$this->data['LastUpdate'][$field_to_update] = time();
// both these work
$this->LastUpdate->save($this->data);
//$this->Artist->LastUpdate->saveAll($this->data);
but this does not:
$artist['LastUpdate']['artist_last_updated'] = date('Y-m-d');
$this->LastUpdate->saveAll($artist);
//neither work:
//$this->LastUpdate->saveAll($artist);
$this->LastUpdate->saveAll($artist['LastUpdate']);
what i'm actually wanting to do is much more complicated. i want to
pass the $artist array around quite a bit to manipulate quite a few
tables' data then at the end just dump $artist back into the database
and it's associated tables.
and pointers would be appreciated.
tx
--
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
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment