]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/History.php
Reviewed nginx configuration
[github/shaarli/Shaarli.git] / application / History.php
index 8074a0172c634912adf507bcd2236d8419cffe81..bd5c1bf7318b63cec18905f99075b5c3a89c3a40 100644 (file)
@@ -3,7 +3,8 @@ namespace Shaarli;
 
 use DateTime;
 use Exception;
-use FileUtils;
+use Shaarli\Bookmark\Bookmark;
+use Shaarli\Helper\FileUtils;
 
 /**
  * Class History
@@ -21,7 +22,7 @@ use FileUtils;
  *   - UPDATED: link updated
  *   - DELETED: link deleted
  *   - SETTINGS: the settings have been updated through the UI.
- *   - IMPORT: bulk links import
+ *   - IMPORT: bulk bookmarks import
  *
  * Note: new events are put at the beginning of the file and history array.
  */
@@ -71,7 +72,7 @@ class History
      * History constructor.
      *
      * @param string $historyFilePath History file path.
-     * @param int    $retentionTime   History content rentention time in seconds.
+     * @param int    $retentionTime   History content retention time in seconds.
      *
      * @throws Exception if something goes wrong.
      */
@@ -97,31 +98,31 @@ class History
     /**
      * Add Event: new link.
      *
-     * @param array $link Link data.
+     * @param Bookmark $link Link data.
      */
     public function addLink($link)
     {
-        $this->addEvent(self::CREATED, $link['id']);
+        $this->addEvent(self::CREATED, $link->getId());
     }
 
     /**
      * Add Event: update existing link.
      *
-     * @param array $link Link data.
+     * @param Bookmark $link Link data.
      */
     public function updateLink($link)
     {
-        $this->addEvent(self::UPDATED, $link['id']);
+        $this->addEvent(self::UPDATED, $link->getId());
     }
 
     /**
      * Add Event: delete existing link.
      *
-     * @param array $link Link data.
+     * @param Bookmark $link Link data.
      */
     public function deleteLink($link)
     {
-        $this->addEvent(self::DELETED, $link['id']);
+        $this->addEvent(self::DELETED, $link->getId());
     }
 
     /**
@@ -135,7 +136,7 @@ class History
     /**
      * Add Event: bulk import.
      *
-     * Note: we don't store links add/update one by one since it can have a huge impact on performances.
+     * Note: we don't store bookmarks add/update one by one since it can have a huge impact on performances.
      */
     public function importLinks()
     {
@@ -146,7 +147,7 @@ class History
      * Save a new event and write it in the history file.
      *
      * @param string $status Event key, should be defined as constant.
-     * @param mixed $id Event item identifier (e.g. link ID).
+     * @param mixed  $id     Event item identifier (e.g. link ID).
      */
     protected function addEvent($status, $id = null)
     {