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
This commit is contained in:
cweiske 2009-10-24 09:10:05 +00:00
parent cc1a0b1e9c
commit 5d11ae2fd5
8 changed files with 9 additions and 51 deletions

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }
}
?>

View file

@ -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; }