I have my user model set to update two dates. If it’s a new record it updates the created date and modified if it’s an update.
What if I want to handle a last login update when a user logs in? Is there a way to do so without it triggering the the modified field? I was thinking perhaps checking to see if the old login has changed or not, but I’ve been able to get the old value for comparison.
Or you can use scenarios. I guess you have this update_time assignment on the side of Yii, right? If yes then it’s very easy to get this behaviour of updating update_time only when current model have scenario equal to for example “update” but not when scenario is “login”.