How do you preserve the updated_at date field when saving the the database in Symfony?
- by Failpunk
This has to be simple...
I'm trying to preserve the current date that is already stored in an updated_at field in the DB.
I'm updating a single field value in the same row and then saving but I don't want it to update the updated_at field. I want to preserve the existing updated_at value.
I only want to do this in one, maybe two situations so I don't need to overwrite the model for every other action in the program.
I've tried this:
$originalDate = $this->getUpdatedAt();
$this->setUpdatedAt($originalDate);
$this->save();
This seems like it should work but still it seems to update the field.