summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-24 09:10:05 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-24 09:10:05 +0000
commit5d11ae2fd5a88b5605aa70167516a571822f0e06 (patch)
tree5403c5da4f7d42e65ce9ba268da36fecae0e1b1a
parentcc1a0b1e9cc2cecdae9d126f1489ee3f12dca531 (diff)
downloadsemanticscuttle-5d11ae2fd5a88b5605aa70167516a571822f0e06.tar.gz
semanticscuttle-5d11ae2fd5a88b5605aa70167516a571822f0e06.tar.bz2
use dbservice in all services that need a db
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@406 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--src/SemanticScuttle/Service/Bookmark2Tag.php9
-rw-r--r--src/SemanticScuttle/Service/CommonDescription.php7
-rw-r--r--src/SemanticScuttle/Service/SearchHistory.php6
-rw-r--r--src/SemanticScuttle/Service/Tag.php9
-rw-r--r--src/SemanticScuttle/Service/Tag2Tag.php7
-rw-r--r--src/SemanticScuttle/Service/TagCache.php6
-rw-r--r--src/SemanticScuttle/Service/TagStat.php8
-rw-r--r--src/SemanticScuttle/Service/User.php8
8 files changed, 9 insertions, 51 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php
index 07d75b9..2702acb 100644
--- a/src/SemanticScuttle/Service/Bookmark2Tag.php
+++ b/src/SemanticScuttle/Service/Bookmark2Tag.php
@@ -1,9 +1,6 @@
<?php
-class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service
+class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
{
- var $tablename;
-
-
/**
* Returns the single service instance
*
@@ -481,9 +478,5 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service
$this->db->sql_query($query);
}
-
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/CommonDescription.php b/src/SemanticScuttle/Service/CommonDescription.php
index ed1ffdd..92327c2 100644
--- a/src/SemanticScuttle/Service/CommonDescription.php
+++ b/src/SemanticScuttle/Service/CommonDescription.php
@@ -1,8 +1,6 @@
<?php
-class SemanticScuttle_Service_CommonDescription extends SemanticScuttle_Service
+class SemanticScuttle_Service_CommonDescription extends SemanticScuttle_DbService
{
- var $tablename;
-
/**
* Returns the single service instance
*
@@ -170,8 +168,5 @@ class SemanticScuttle_Service_CommonDescription extends SemanticScuttle_Service
$this->db->sql_query($query);
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/SearchHistory.php b/src/SemanticScuttle/Service/SearchHistory.php
index 7cffa83..b50d056 100644
--- a/src/SemanticScuttle/Service/SearchHistory.php
+++ b/src/SemanticScuttle/Service/SearchHistory.php
@@ -1,7 +1,6 @@
<?php
-class SemanticScuttle_Service_SearchHistory extends SemanticScuttle_Service
+class SemanticScuttle_Service_SearchHistory extends SemanticScuttle_DbService
{
- var $tablename;
var $sizeSearchHistory;
/**
@@ -127,8 +126,5 @@ class SemanticScuttle_Service_SearchHistory extends SemanticScuttle_Service
$this->db->sql_query($query);
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php
index 2a70948..c863640 100644
--- a/src/SemanticScuttle/Service/Tag.php
+++ b/src/SemanticScuttle/Service/Tag.php
@@ -1,8 +1,6 @@
<?php
-class SemanticScuttle_Service_Tag extends SemanticScuttle_Service
+class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService
{
- var $tablename;
-
/**
* Returns the single service instance
*
@@ -95,7 +93,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_Service
}
function renameTag($uId, $oldName, $newName) {
- $newname = $this->normalize($newname);
+ $newname = $this->normalize($newName);
$query = 'UPDATE `'. $this->getTableName() .'`';
$query.= ' SET tag="'.$newName.'"';
@@ -126,8 +124,5 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_Service
$this->db->sql_query($query);
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/Tag2Tag.php b/src/SemanticScuttle/Service/Tag2Tag.php
index d283b57..41e26bf 100644
--- a/src/SemanticScuttle/Service/Tag2Tag.php
+++ b/src/SemanticScuttle/Service/Tag2Tag.php
@@ -1,8 +1,6 @@
<?php
-class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service
+class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_DbService
{
- protected $tablename;
-
/**
* Returns the single service instance
*
@@ -381,8 +379,5 @@ class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service
$tsts->deleteAll();
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/TagCache.php b/src/SemanticScuttle/Service/TagCache.php
index 95f3ea8..7f5a157 100644
--- a/src/SemanticScuttle/Service/TagCache.php
+++ b/src/SemanticScuttle/Service/TagCache.php
@@ -10,9 +10,8 @@
* The table must be updated for each modification of
* the relations between tags.
*/
-class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service
+class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
{
- var $tablename;
/**
* Returns the single service instance
@@ -354,8 +353,5 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service
$this->db->sql_query($query);
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/TagStat.php b/src/SemanticScuttle/Service/TagStat.php
index 1bb7b05..0c0b70a 100644
--- a/src/SemanticScuttle/Service/TagStat.php
+++ b/src/SemanticScuttle/Service/TagStat.php
@@ -1,9 +1,6 @@
<?php
-class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service
+class SemanticScuttle_Service_TagStat extends SemanticScuttle_DbService
{
-
- var $tablename;
-
/**
* Returns the single service instance
*
@@ -197,8 +194,5 @@ class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service
$this->db->sql_query($query);
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
}
?>
diff --git a/src/SemanticScuttle/Service/User.php b/src/SemanticScuttle/Service/User.php
index 49951d1..bc9ebfe 100644
--- a/src/SemanticScuttle/Service/User.php
+++ b/src/SemanticScuttle/Service/User.php
@@ -1,13 +1,11 @@
<?php
-class SemanticScuttle_Service_User extends SemanticScuttle_Service
+class SemanticScuttle_Service_User extends SemanticScuttle_DbService
{
- protected $db;
protected $fields = array(
'primary' => 'uId',
'username' => 'username',
'password' => 'password');
protected $profileurl;
- protected $tablename;
protected $sessionkey;
protected $cookiekey;
protected $cookietime = 1209600; // 2 weeks
@@ -569,10 +567,6 @@ class SemanticScuttle_Service_User extends SemanticScuttle_Service
return $_SESSION['sessionStable'] == 1;
}
- // Properties
- function getTableName() { return $this->tablename; }
- function setTableName($value) { $this->tablename = $value; }
-
function getFieldName($field) { return $this->fields[$field]; }
function setFieldName($field, $value) { $this->fields[$field] = $value; }