Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443488
Commits
65006002
Commit
65006002
authored
16 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#162678
by robertDouglass, catch, and Damien Tournoud: Add static caching for
parent
da7f3a0e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/taxonomy/taxonomy.module
+18
-2
18 additions, 2 deletions
modules/taxonomy/taxonomy.module
with
18 additions
and
2 deletions
modules/taxonomy/taxonomy.module
+
18
−
2
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
];
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment