summaryrefslogtreecommitdiffstatshomepage
path: root/src/SemanticScuttle/Service/TagStat.php
diff options
context:
space:
mode:
authorGravatar cweiske2009-10-03 21:52:30 +0000
committerGravatar cweiske2009-10-03 21:52:30 +0000
commitd5f09b7e4d802cdc2d5f3f876c48ea918c961488 (patch)
treeaa1eb37219c17bef03b1515e5074b4743f89a9a3 /src/SemanticScuttle/Service/TagStat.php
parentb7345f833dea849e94f2ce23fdbe6ab58ba98be3 (diff)
downloadscuttle-d5f09b7e4d802cdc2d5f3f876c48ea918c961488.tar.gz
scuttle-d5f09b7e4d802cdc2d5f3f876c48ea918c961488.zip
make the application work again
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@388 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src/SemanticScuttle/Service/TagStat.php')
-rw-r--r--src/SemanticScuttle/Service/TagStat.php31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/SemanticScuttle/Service/TagStat.php b/src/SemanticScuttle/Service/TagStat.php
index 9d3ca5d..c54dcb7 100644
--- a/src/SemanticScuttle/Service/TagStat.php
+++ b/src/SemanticScuttle/Service/TagStat.php
@@ -1,22 +1,33 @@
<?php
-class TagStatService {
- var $db;
+class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service
+{
+
var $tablename;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new TagStatService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function TagStatService(&$db) {
- $this->db =& $db;
+ protected function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'tagsstats';
}
function getNbChildren($tag1, $relationType, $uId) {
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$query = "SELECT tag1, relationType, uId FROM `". $tts->getTableName() ."`";
$query.= " WHERE tag1 = '" .$tag1 ."'";
$query.= " AND relationType = '". $relationType ."'";
@@ -91,7 +102,7 @@ class TagStatService {
return false;
}
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$linkedTags = $tts->getLinkedTags($tag1, $relationType, $uId);
$nbDescendants = 0;
$maxDepth = 0;
@@ -112,7 +123,7 @@ class TagStatService {
}
function updateAllStat() {
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$query = "SELECT tag1, uId FROM `". $tts->getTableName() ."`";
$query.= " WHERE relationType = '>'";