]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/bookmark/LinkUtils.php
Introduce Bookmark object and Service layer to retrieve them
[github/shaarli/Shaarli.git] / application / bookmark / LinkUtils.php
index 77eb2d95dd480e09663e8639174675df3755a210..8837943037dd52468ff6e73bbbc39f8e669b1b04 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-use Shaarli\Bookmark\LinkDB;
+use Shaarli\Bookmark\Bookmark;
 
 /**
  * Get cURL callback function for CURLOPT_WRITEFUNCTION
@@ -188,30 +188,11 @@ function html_extract_tag($tag, $html)
 }
 
 /**
- * Count private links in given linklist.
- *
- * @param array|Countable $links Linklist.
- *
- * @return int Number of private links.
- */
-function count_private($links)
-{
-    $cpt = 0;
-    foreach ($links as $link) {
-        if ($link['private']) {
-            $cpt += 1;
-        }
-    }
-
-    return $cpt;
-}
-
-/**
- * In a string, converts URLs to clickable links.
+ * In a string, converts URLs to clickable bookmarks.
  *
  * @param string $text       input string.
  *
- * @return string returns $text with all links converted to HTML links.
+ * @return string returns $text with all bookmarks converted to HTML bookmarks.
  *
  * @see Function inspired from http://www.php.net/manual/en/function.preg-replace.php#85722
  */
@@ -279,7 +260,7 @@ function format_description($description, $indexUrl = '')
  */
 function link_small_hash($date, $id)
 {
-    return smallHash($date->format(LinkDB::LINK_DATE_FORMAT) . $id);
+    return smallHash($date->format(Bookmark::LINK_DATE_FORMAT) . $id);
 }
 
 /**