Utility class for encoding weighted tags.
More...
◆ buildTagWeightsFromLegacyParameters()
static CirrusSearch\Extra\MultiList\MultiListBuilder::buildTagWeightsFromLegacyParameters |
( |
| $tagNames = null, |
|
|
| $tagWeights = null ) |
|
static |
Merges $tagNames
and $tagWeights
into a single map that can be passed to buildWeightedTags
.
- Parameters
-
null | string | string[] | $tagNames | Optional tag name or list of tag names. Each tag will be set for each target ID. Omit for tags which are fully defined by their prefix. |
null | int | int[] | $tagWeights | Optional tag weight(s).
- If
$tagNames is null, an integer.
- Otherwise, a
[ tagName => weight ] map. This may only use a subset of $tagNames as keys.
- However, only valid keys (which exist in
$tagNames ) will result in returned tags.
|
A single weight ranges between 1-1000.
- Returns
- null[]|int[] A map of tag weights keyed by tag name
- See also
- buildWeightedTags
-
buildWeightedTagsFromLegacyParameters
◆ buildWeightedTags()
static CirrusSearch\Extra\MultiList\MultiListBuilder::buildWeightedTags |
( |
string | $tagPrefix, |
|
|
?array | $tagWeightsByName = null ) |
|
static |
- Parameters
-
string | $tagPrefix | A prefix shared by all $tagNames |
null | null[] | int[] | $tagWeightsByName | Optional tag weights. A map of optional weights, keyed by tag name. Omit for tags which are fully defined by their prefix. A single weight ranges between 1-1000. |
- Returns
- MultiListWeightedTag[]
◆ buildWeightedTagsFromLegacyParameters()
static CirrusSearch\Extra\MultiList\MultiListBuilder::buildWeightedTagsFromLegacyParameters |
( |
string | $tagPrefix, |
|
|
| $tagNames = null, |
|
|
| $tagWeights = null ) |
|
static |
- Parameters
-
string | $tagPrefix | A prefix shared by all $tagNames |
string | string[] | null | $tagNames | Optional tag name or list of tag names. Each tag will be set for each target ID. Omit for tags which are fully defined by their prefix. |
int | int[] | null | $tagWeights | Optional tag weight(s).
- If
$tagNames is null, an integer.
- Otherwise, a
[ tagName => weight ] map. This may only use a subset of $tagNames as keys. However, only valid keys (which exist in $tagNames ) will result in returned tags.
|
A single weight ranges between 1-1000.
- Returns
- MultiListWeightedTag[]
- Deprecated
- use
buildWeightedTags
instead use buildTagWeightsFromLegacyParameters
to migrate
The documentation for this class was generated from the following file:
- includes/Extra/MultiList/MultiListBuilder.php