Hi all,

In the UrlsController I have the action stopTracking() (see bellow)
that gets list of indexes of urls which I want to set `research` = -1
for:

But the $this->Url->save(); generate update query with `research` not
changed.

For instance:
INPUT: $this->data['Url']['tracking'] = arrray(0 => 4862);
OUTPUT QUERY: (research value remains unchanged, equal to it's value
on the database.)
UPDATE `urls` SET `id` = 4862, `research` = 1 WHERE `urls`.`id` = 4862
EXPECTED QUERY:
UPDATE `urls` SET `id` = 4862, `research` = -1 WHERE `urls`.`id` =
4862

Controller's Action:
    function stopTracking()
    {
        foreach($this->data['Url']['tracking'] as $stopTrackingId)
        {
            $this->Url->id = $stopTrackingId;
            $this->Url->read(null, $stopTrackingId);
            $this->Url->set('research', -1);
            $this->Url->save();
        }

        $this->redirect('urls/index', null, true);
    }

Thanks a lot :)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to