History: fix entries order
This commit is contained in:
parent
57ce6dae5d
commit
6bc90f50af
2 changed files with 15 additions and 16 deletions
|
@ -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'));
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue