/** * @PrePersist * @PreUpdate */ public function updateTimestamps() { $this->_updated = MySqlDateTime::nowTimestamp(); if ($this->_created == '') { $this->_created = MySqlDateTime::nowTimestamp(); } }
public function test_proper_length_of_datetime_string_returned() { $mysqlNow = MySqlDateTime::nowTimestamp(); $this->assertEqual(strlen($mysqlNow), 19); }