{
$result = parent::insert();
if ($result) {
+ $this->fixupTimestamps();
$this->encache(); // in case of cached negative lookups
}
return $result;
}
$result = parent::update($orig);
if ($result) {
+ $this->fixupTimestamps();
$this->encache();
}
return $result;
}
/**
- * sends query to database - this is the private one that must work
+ * sends query to database - this is the private one that must work
* - internal functions use this rather than $this->query()
*
* Overridden to do logging.
return $c->delete($cacheKey);
}
+
+ function fixupTimestamps()
+ {
+ // Fake up timestamp columns
+ $columns = $this->table();
+ foreach ($columns as $name => $type) {
+ if ($type & DB_DATAOBJECT_MYSQLTIMESTAMP) {
+ $this->$name = common_sql_now();
+ }
+ }
+ }
+
+ function debugDump()
+ {
+ common_debug("debugDump: " . common_log_objstring($this));
+ }
}