Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Prevent updated_at change on minior change
  • Is there an easy way to prevent that the Updatedat observer updates the date, if there are changes on specific properties?

    For example:
    I have a Model_Article with the property "counter". 
    Every time a display the article to the user (www.example.com/articles/4711) I update this field. In this case, the observer also updates the updated at field. is there a way (I know I could override the observer class) to prevent this behaviour?
  • Harro VertonHarro Verton
    Accepted Answer
    By overriding the observer class... ;-)
  • Accepted, but I found a better solution. I just update the row by hand (with \Db::update) instead of $obj->save(). This solution not only solves my problem above, but also prevents all the other observers to get triggered (I don't need them in this situation, what is a small performance improvement :D
  • Yup, that works too. ;-)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion