How do you preserve the updated_at date field when saving the the database in Symfony?
Posted
by Failpunk
on Stack Overflow
See other posts from Stack Overflow
or by Failpunk
Published on 2009-09-13T10:03:58Z
Indexed on
2010/03/29
10:03 UTC
Read the original article
Hit count: 155
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.
© Stack Overflow or respective owner