I'm not sure what the problem is but I wonder why you're bothering to
update the CSV file after an edit. I would just create a controller
action through which the CSV is fetched and create it at that time
using the latest data. You can always cache the file if you expect
that it will be fetched often enough. Just be sure to remove the cache
whenever relevant data is added/updated.

On Fri, Jul 6, 2012 at 6:06 AM, Ernesto <e.fanz...@gmail.com> wrote:
> Hi all
>
> i'm having a weird issue with Cake 2.2 model's afterSave()
>
> i need to update some csv files after any order has been saved or updated.
> to achieve this i made a function "processCsv" wich is called by my
> afterSave().
>
> but my finds() called afterSave() are returning the data without the last
> updates. why?
>
> here's my code
>
> //in controller
> $this->Order->save($this->data);
>
> //in Order model
> public function afterSave ($created) {
>     $this->processCsv($this->data["Order"]["id"]);
> }
>
> public function processCsv ($id) {
>     pr($this->findById($id));
>     //my code goes here
> }
>
> --
> 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+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to