Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
304
Merge Requests
304
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
65006002
Commit
65006002
authored
Oct 11, 2008
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#162678
by robertDouglass, catch, and Damien Tournoud: Add static caching for
parent
da7f3a0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
modules/taxonomy/taxonomy.module
modules/taxonomy/taxonomy.module
+18
-2
No files found.
modules/taxonomy/taxonomy.module
View file @
65006002
...
...
@@ -896,9 +896,25 @@ function taxonomy_get_synonyms($tid) {
/**
* Return the term object that has the given string as a synonym.
*
* @param $synonym
* The string to compare against.
* @param $reset
* Whether to reset the internal cache for this synonym.
* @return
* A term object, or FALSE if no matching term is found.
*/
function
taxonomy_get_synonym_root
(
$synonym
)
{
return
db_fetch_object
(
db_query
(
"SELECT * FROM
{
term_synonym
}
s,
{
term_data
}
t WHERE t.tid = s.tid AND s.name = '%s'"
,
$synonym
));
function
taxonomy_get_synonym_root
(
$synonym
,
$reset
=
FALSE
)
{
static
$synonyms
=
array
();
if
(
$reset
)
{
unset
(
$synonyms
[
$synonym
]);
}
if
(
!
isset
(
$synonyms
[
$synonym
]))
{
$synonyms
[
$synonym
]
=
db_query
(
"SELECT * FROM
{
term_synonym
}
s,
{
term_data
}
t WHERE t.tid = s.tid AND s.name = :name"
,
array
(
':name'
=>
$synonym
))
->
fetch
();
}
return
$synonyms
[
$synonym
];
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment