]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - ReferenceHistory.php
f19cdf2fbd9abd94cdca7628ada7a42ae20a8529
6 * Populates a reference history
12 private $history = [];
15 * Populates the test DB with reference data
17 public function __construct()
21 DateTime
::createFromFormat('Ymd_His', '20170303_121216'),
27 DateTime
::createFromFormat('Ymd_His', '20170302_121215')
32 DateTime
::createFromFormat('Ymd_His', '20170301_121214'),
38 DateTime
::createFromFormat('Ymd_His', '20170201_121214'),
44 DateTime
::createFromFormat('Ymd_His', '20170101_121212'),
50 * Adds a new history entry
52 * @param string $event Event identifier
53 * @param DateTime $datetime creation date
54 * @param int $id optional: related link ID
56 protected function addEntry($event, $datetime, $id = null)
60 'datetime' => $datetime,
63 $this->history
[] = $link;
68 * Writes data to the datastore
70 * @param string $filename write history content to.
72 public function write($filename)
74 FileUtils
::writeFlatDB($filename, $this->history
);
78 * Returns the number of links in the reference data
80 public function count()