Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
f4182e04
Commit
f4182e04
authored
1 month ago
by
JonGold
Committed by
colemanw
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Faster pseudoconstant name lookups
parent
1d36903f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Contact/BAO/Query.php
+4
-5
4 additions, 5 deletions
CRM/Contact/BAO/Query.php
with
4 additions
and
5 deletions
CRM/Contact/BAO/Query.php
+
4
−
5
View file @
f4182e04
...
...
@@ -5987,7 +5987,7 @@ AND displayRelType.is_active = 1
if
(
empty
(
$this
->
_pseudoConstantsSelect
))
{
return
NULL
;
}
$values
=
[];
$values
=
$labels
=
[];
foreach
(
$this
->
_pseudoConstantsSelect
as
$key
=>
$value
)
{
if
(
!
empty
(
$this
->
_pseudoConstantsSelect
[
$key
][
'sorting'
]))
{
continue
;
...
...
@@ -6009,10 +6009,11 @@ AND displayRelType.is_active = 1
// and we can use the metadata to figure it out.
// ideally this bit of IF will absorb & replace all the rest in time as we move to
// more metadata based choices.
$labels
[
$value
[
'bao'
]][
$value
[
'idCol'
]]
??=
$value
[
'bao'
]
::
buildOptions
(
$value
[
'idCol'
],
'get'
);
if
(
str_contains
(
$val
,
CRM_Core_DAO
::
VALUE_SEPARATOR
))
{
$dbValues
=
explode
(
CRM_Core_DAO
::
VALUE_SEPARATOR
,
trim
(
$val
,
CRM_Core_DAO
::
VALUE_SEPARATOR
));
foreach
(
$dbValues
as
$pseudoValue
)
{
$convertedValues
[]
=
CRM_Core_PseudoConstant
::
getL
abel
(
$value
[
'bao'
]
,
$value
[
'idCol'
]
,
$pseudoValue
)
;
$convertedValues
[]
=
$l
abel
s
[
$value
[
'bao'
]
][
$value
[
'idCol'
]
][
$pseudoValue
]
??
NULL
;
}
$dao
->
$key
=
(
$usedForAPI
)
?
$convertedValues
:
implode
(
', '
,
$convertedValues
);
...
...
@@ -6027,9 +6028,7 @@ AND displayRelType.is_active = 1
}
else
{
// This is basically the same as the default but since we have the bao we can use
// a cached function.
$dao
->
$key
=
CRM_Core_PseudoConstant
::
getLabel
(
$value
[
'bao'
],
$value
[
'idCol'
],
$val
);
$dao
->
$key
=
$labels
[
$value
[
'bao'
]][
$value
[
'idCol'
]][
$val
]
??
NULL
;
}
}
elseif
(
$baoName
)
{
...
...
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