summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service/Bookmark.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 19:32:48 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 19:32:48 +0000
commit09fffebffe9ab1cf7622aa141150157b0746e20d (patch)
treeaf3767fbc293d64c56c7dcf54c584b72cca8195f /src/SemanticScuttle/Service/Bookmark.php
parentb38d876fad5d2ba080a87f9667dea4a3a1cca7f5 (diff)
downloadsemanticscuttle-09fffebffe9ab1cf7622aa141150157b0746e20d.tar.gz
semanticscuttle-09fffebffe9ab1cf7622aa141150157b0746e20d.tar.bz2
test if deleting bookmarks works. to do this, we need a new testbase method to create users, plus we need to return the uid when creating a new user. registration process needs to be adopted to that.
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@417 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src/SemanticScuttle/Service/Bookmark.php')
-rw-r--r--src/SemanticScuttle/Service/Bookmark.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark.php b/src/SemanticScuttle/Service/Bookmark.php
index 29a2291..82e23a3 100644
--- a/src/SemanticScuttle/Service/Bookmark.php
+++ b/src/SemanticScuttle/Service/Bookmark.php
@@ -212,9 +212,9 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
*/
public function addBookmark(
$address, $title, $description, $privateNote, $status, $categories,
- $date = null, $fromApi = false, $fromImport = false, $sId = -1
+ $date = null, $fromApi = false, $fromImport = false, $sId = null
) {
- if ($sId == -1) {
+ if ($sId === null) {
$userservice = SemanticScuttle_Service_Factory::get('User');
$sId = $userservice->getCurrentUserId();
}
@@ -436,16 +436,17 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
$terms = null, $sortOrder = null, $watched = null,
$startdate = null, $enddate = null, $hash = null
) {
- $userservice =SemanticScuttle_Service_Factory::get('User');
- $b2tservice =SemanticScuttle_Service_Factory::get('Bookmark2Tag');
- $tag2tagservice =SemanticScuttle_Service_Factory::get('Tag2Tag');
- $sId = $userservice->getCurrentUserId();
+ $userservice = SemanticScuttle_Service_Factory::get('User');
+ $b2tservice = SemanticScuttle_Service_Factory::get('Bookmark2Tag');
+ $tag2tagservice = SemanticScuttle_Service_Factory::get('Tag2Tag');
+ $sId = $userservice->getCurrentUserId();
if ($userservice->isLoggedOn()) {
- // All public bookmarks, user's own bookmarks and any shared with user
+ // All public bookmarks, user's own bookmarks
+ // and any shared with user
$privacy = ' AND ((B.bStatus = 0) OR (B.uId = '. $sId .')';
$watchnames = $userservice->getWatchNames($sId, true);
- foreach($watchnames as $watchuser) {
+ foreach ($watchnames as $watchuser) {
$privacy .= ' OR (U.username = "'. $watchuser .'" AND B.bStatus = 1)';
}
$privacy .= ')';