History: fix entries order

This commit is contained in:
ArthurHoaro 2017-05-07 16:56:20 +02:00
parent 57ce6dae5d
commit 6bc90f50af
2 changed files with 15 additions and 16 deletions

View file

@ -29,7 +29,6 @@ class History extends ApiController
public function getHistory($request, $response)
{
$history = $this->history->getHistory();
$history = array_reverse($history);
// Return history operations from the {offset}th, starting from {since}.
$since = \DateTime::createFromFormat(\DateTime::ATOM, $request->getParam('since'));

View file

@ -15,8 +15,19 @@ class ReferenceHistory
public function __construct()
{
$this->addEntry(
History::CREATED,
DateTime::createFromFormat('Ymd_His', '20170101_121212'),
History::DELETED,
DateTime::createFromFormat('Ymd_His', '20170303_121216'),
124
);
$this->addEntry(
History::SETTINGS,
DateTime::createFromFormat('Ymd_His', '20170302_121215')
);
$this->addEntry(
History::UPDATED,
DateTime::createFromFormat('Ymd_His', '20170301_121214'),
123
);
@ -27,21 +38,10 @@ class ReferenceHistory
);
$this->addEntry(
History::UPDATED,
DateTime::createFromFormat('Ymd_His', '20170301_121214'),
History::CREATED,
DateTime::createFromFormat('Ymd_His', '20170101_121212'),
123
);
$this->addEntry(
History::SETTINGS,
DateTime::createFromFormat('Ymd_His', '20170302_121215')
);
$this->addEntry(
History::DELETED,
DateTime::createFromFormat('Ymd_His', '20170303_121216'),
124
);
}
/**