touch behavior:
http://bakery.cakephp.org/articles/view/touchbehavior

On Jan 15, 4:20 am, Alfred Pakenham <alfred.paken...@gmail.com> wrote:
> Hi,
> I'm sure I have seen this somewhere, but can't remember where. How do I save
> a field and make sure that modified is not changed?
> For example I have a view column in my posts table, in my view action I do
> this after finding the post:
> $views = $post['Post']['views'] + 1;
> $this->Post->id = $post['Post']['id'];
> $this->Post->saveField('views', $views);
>
> Now, I understand that modifying a record and not wanting to affect modified
> field may sound odd, but there are rare cases when you want to do that,
> yet many more when you want standard behavior. The only solution I have
> found so far is to directly use query, which understandably I would like to
> avoid.
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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