SearchVariantSiteTreeSubsitesPolyhome
class SearchVariantSiteTreeSubsitesPolyhome extends SearchVariant (View source)
Properties
protected static | $variants | Holds a cache of all variants |
from SearchVariant | |
protected static | $class_variants | Holds a cache of the variants keyed by "class!" "1"? (1 = include subclasses) |
from SearchVariant | |
protected static | $call_instances | Holds a cache of SearchVariant_Caller instances, one for each class/includeSubclasses setting |
from SearchVariant | |
public static | $subsites |
Methods
Return false if there is something missing from the environment (probably a not installed module) that means this variant can't apply to any class
Return true if this variant applies to the passed class & subclass
Returns an array of variants.
Lets you call any function on all variants that support it, in the same manner as "Object#extend" calls a method from extensions.
A shortcut to with when calling without passing in a class,
Get the current state of every variant
Activate all the states in the passed argument
Return an iterator that, when used in a for loop, activates one combination of reindex states per loop, and restores back to the original state at the end
Add new filter field to index safely.
Merge sets of (or individual) class names together for a search index field.
We need really complicated logic to find just the changed subsites (because we use versions there's no explicit deletes, just new versions with different members) so just always use all of them
Details
__construct()
No description
appliesToEnvironment()
Return false if there is something missing from the environment (probably a not installed module) that means this variant can't apply to any class
appliesTo($class, $includeSubclasses)
Return true if this variant applies to the passed class & subclass
currentState()
Return the current state
reindexStates()
Return all states to step through to reindex all items
activateState($state)
Activate the passed state
alterQuery(SearchQuery $query, SearchIndex $index)
Apply this variant to a search query
static array
variants(string $class = null, bool $includeSubclasses = true)
Returns an array of variants.
With no arguments, returns all variants
With a classname as the first argument, returns the variants that apply to that class (optionally including subclasses)
static SearchVariant_Caller
with(string $class = null, bool $includeSubclasses = true)
Lets you call any function on all variants that support it, in the same manner as "Object#extend" calls a method from extensions.
Usage: SearchVariant::with(...)->call($method, $arg1, ...);
static
call($method, $a1 = null, $a2 = null, $a3 = null, $a4 = null, $a5 = null, $a6 = null, $a7 = null)
A shortcut to with when calling without passing in a class,
SearchVariant::call(...) ==== SearchVariant::with()->call(...);
static array
current_state($class = null, $includeSubclasses = true)
Get the current state of every variant
static void
activate_state($state)
Activate all the states in the passed argument
static SearchVariant_ReindexStateIteratorRet
reindex_states(string $class = null, bool $includeSubclasses = true)
Return an iterator that, when used in a for loop, activates one combination of reindex states per loop, and restores back to the original state at the end
protected
addFilterField(SearchIndex $index, string $name, array $field)
Add new filter field to index safely.
This method will respect existing filters with the same field name that correspond to multiple classes
protected array|string
mergeClasses(array|string $left, array|string $right)
Merge sets of (or individual) class names together for a search index field.
If there is only one unique class name, then just return it as a string instead of array.
alterDefinition($class, $index)
No description
extractManipulationWriteState($writes)
We need really complicated logic to find just the changed subsites (because we use versions there's no explicit deletes, just new versions with different members) so just always use all of them