DirectorActivityLog: allow to loadLatest()

This commit is contained in:
Thomas Gelf 2016-05-25 15:23:57 +02:00
parent 95afce9d5a
commit 984f28bfdc

View File

@ -43,6 +43,13 @@ class DirectorActivityLog extends DbObject
}
}
public static function loadLatest(Db $connection)
{
$db = $connection->getDbAdapter();
$query = $db->select()->from($this->table, array('id' => 'MAX(id)'));
return static::load($db->fetchOne($query));
}
public static function logCreation(DbObject $object, Db $db)
{
$data = array(