Symfony 2中我的数据库中最后一次插入/更新/删除的时间

I need a function that returns last time of insert / update / delete in my database. I use Symfony 2 and Doctrine 2.

I have tried this raw query, but UPDATE_TIME is always NULL:

$connection = $this->getDoctrine()->getConnection();
$database = $connection->getDatabase();

$result = $connection->fetchAll('
    SELECT MAX(UPDATE_TIME)
    FROM information_schema.tables
    WHERE TABLE_SCHEMA = "' . $database . '"
');

How can I get this last time in Symfony or Doctrine? Thanks.

I bet you're using InnoDB, and InnoDB doesn't support UPDATE_TIME.

Your best bet is to create an event and populate/update a table each time you're inserting/updating a row.