Hi!
I use the Timestampable behavior on a model.
The model counts how often it was shown at a column "views".
Well as you might imagin, I want to update the views-column without
changing the updated_at-value.
How can I do this?
example:
public function incrementNbViews()
{
$invoker = $this->getInvoker();
// increment
$invoker->setNbViews($invoker->getNbViews() + 1);
// save
$q = Doctrine::getTable(get_class($invoker))->createQuery();
$q->update()
->set($q->getRootAlias().'.nb_views', '?',
$invoker->getNbViews())
->where($q->getRootAlias().'.id = ?', $invoker->getId())
->execute();
}
=> updated_at should NOT change, but it does.
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" 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/symfony-users?hl=en