From 5d11ae2fd5a88b5605aa70167516a571822f0e06 Mon Sep 17 00:00:00 2001 From: cweiske Date: Sat, 24 Oct 2009 09:10:05 +0000 Subject: 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 --- src/SemanticScuttle/Service/Bookmark2Tag.php | 9 +-------- src/SemanticScuttle/Service/CommonDescription.php | 7 +------ src/SemanticScuttle/Service/SearchHistory.php | 6 +----- src/SemanticScuttle/Service/Tag.php | 9 ++------- src/SemanticScuttle/Service/Tag2Tag.php | 7 +------ src/SemanticScuttle/Service/TagCache.php | 6 +----- src/SemanticScuttle/Service/TagStat.php | 8 +------- src/SemanticScuttle/Service/User.php | 8 +------- 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ '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; } -- cgit v1.2.3