aboutsummaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/Service
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2013-03-21 17:57:12 +0100
committerChristian Weiske <cweiske@cweiske.de>2013-03-21 17:57:12 +0100
commit5c8833d5f50086e7a2362166f878c947697e4221 (patch)
treeaabd1c6c5b32c84a2a725cfaaa760e7d81e53403 /src/SemanticScuttle/Service
parent1cc149fbd6a621edfa404561a84ce1e4b3552c18 (diff)
downloadsemanticscuttle-5c8833d5f50086e7a2362166f878c947697e4221.tar.gz
semanticscuttle-5c8833d5f50086e7a2362166f878c947697e4221.tar.bz2
CS
Diffstat (limited to 'src/SemanticScuttle/Service')
-rw-r--r--src/SemanticScuttle/Service/TagCache.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/SemanticScuttle/Service/TagCache.php b/src/SemanticScuttle/Service/TagCache.php
index 0fdb986..64ec0cc 100644
--- a/src/SemanticScuttle/Service/TagCache.php
+++ b/src/SemanticScuttle/Service/TagCache.php
@@ -308,8 +308,11 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
/*
* Return values associated with a key.
* $tagExcepted allows to hide a value.
+ *
+ * @return array Array with tag names
*/
- function _getSynonymValues($tag1, $uId, $tagExcepted = NULL) {
+ protected function _getSynonymValues($tag1, $uId, $tagExcepted = NULL)
+ {
$tagservice =SemanticScuttle_Service_Factory::get('Tag');
$tag1 = $tagservice->normalize($tag1);
$tagExcepted = $tagservice->normalize($tagExcepted);
@@ -317,14 +320,19 @@ class SemanticScuttle_Service_TagCache extends SemanticScuttle_DbService
if($tag1 == '') return false;
$query = "SELECT DISTINCT tag2 as 'tag'";
- $query.= " FROM `". $this->getTableName() ."`";
- $query.= " WHERE relationType = '='";
- $query.= " AND tag1 = '" . $this->db->sql_escape($tag1) . "'";
- $query.= " AND uId = " . intval($uId);
- $query.= $tagExcepted!=''?" AND tag2!='" . $this->db->sql_escape($tagExcepted) . "'" : '';
+ $query .= " FROM `". $this->getTableName() ."`";
+ $query .= " WHERE relationType = '='";
+ $query .= " AND tag1 = '" . $this->db->sql_escape($tag1) . "'";
+ $query .= " AND uId = " . intval($uId);
+ $query .= $tagExcepted != ''
+ ? " AND tag2!='" . $this->db->sql_escape($tagExcepted) . "'"
+ : '';
if (! ($dbresult = $this->db->sql_query($query)) ){
- message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
+ message_die(
+ GENERAL_ERROR, 'Could not get related tags',
+ '', __LINE__, __FILE__, $query, $this->db
+ );
return false;
}