If you're using Model::save(), then no, there's no way to deactivate
it (that I know of).
However, you could try this:
$this->MyModel->updateAll(array('visits' => 'visits+1'), array('id' =>
{{whatever}}));
This will update the record, but will not call beforeSave(),
afterSave(), or update any other fields. It will just do a straight
sql update.
On Jan 24, 4:58 pm, Andrew Assarattanakul <[EMAIL PROTECTED]> wrote:
> It probably would be better to create a separate table to take care of
> the visit counter so that you don't have to stop a built in
> convention. This way if you have a modified field in the visit table
> you can also see when the last time someone visited that page.
>
> On Jan 24, 8:57 am, Jakanapes <[EMAIL PROTECTED]> wrote:
>
> > I have a small app I'm working on and I'm trying to port it over to
> > cakePHP for easier handling.
>
> > There is a table that serves pages and I want the modified field to be
> > updated on an edit, but I have a visits field that I increment so I
> > can track the most popular page views and I don't want to update the
> > modified every time the page is selected. Is there a way to tell cake
> > not to update the modified field?
>
> > TIA
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---