I was debugging some filter code and came across some side effects I
never noticed before and wanted to confirm them and whether or not
these effects should be assumed by code or not.

I noticed that invoking $this->model->read() always sets $this->data
to the results. Never knew this before, always figured I needed to set
it myself. Can/Should I rely on this?

I also noticed (I think) that invoking $this->model->save() also sets
$this->data to the updated record contents. Once again can/should I
rely on this?

I noticed this in some filters where I was looking at $this-
>model[model][id] to determine if I was in a create or edit mode, and
had some code to update some dependent fields in other models. When I
invoked code in other models I noticed $this->data was cleared on the
invokation. When the other model code did a read it instantiated $this-
>data, and further if the other model called save $this->data
immediately reflected the updated values even though I had not set it
explicitly.

Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
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