Re: beforeSave not working with saveMany?

2012-06-05 Thread Benjamin Allison
Hmm. In doing a saveMany, [this->alias] isn't defined. saveMany uses a numerical index. On Tuesday, 5 June 2012 18:06:47 UTC-4, stork wrote: > > $this->data[$this->alias]['foo'] = 'bar'; > > or > > $this->set('foo', 'bar'); -- Our newest site for the community: CakePHP Video Tutorials http://t

Re: beforeSave not working with saveMany?

2012-06-05 Thread stork
public function beforeSave($options = array()) { $this->set('foo', 'bar'); return parent::beforeSave($options); } -- 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

Re: beforeSave not working with saveMany?

2012-06-05 Thread stork
$this->data[$this->alias]['foo'] = 'bar'; or $this->set('foo', 'bar'); -- 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 fr

beforeSave not working with saveMany?

2012-06-05 Thread Benjamin Allison
So, for some reason, anything I do to data in the beforeSave callback, though it works on single records, does not work when using saveMany. What gives? If i do the following: public function beforeSave() { $this->data['foo'] = 'bar' die($this->data); } $this->data does in fact get changed,