Class IndexRegistry
Factory/Registry class for Index objects.
Handles ensuring only one instance of each index is created and that the correct connection is injected in.
Provides an interface similar to Cake\ORM\TableRegistry.
Property Summary
-
$instances protected static
array
The map of instances in the registry.
-
$options protected static
array
List of options by alias passed to get.
Method Summary
-
clear() public static
Clears the registry of configuration and instances.
-
exists() public static
Check to see if an instance exists in the registry.
-
get() public static
Get/Create an instance from the registry.
-
remove() public static
Removes an instance from the registry.
-
set() public static
Set an instance.
Method Detail
clear() ¶ public static
clear(): void
Clears the registry of configuration and instances.
Returns
void
exists() ¶ public static
exists(string $alias): bool
Check to see if an instance exists in the registry.
Parameters
-
string
$alias The alias to check for.
Returns
bool
get() ¶ public static
get(string $alias, array $options = []): Cake\ElasticSearch\Index
Get/Create an instance from the registry.
When getting an instance, if it does not already exist, a new instance will be created using the provide alias, and options.
Parameters
-
string
$alias The name of the alias to get.
-
array
$options optional Configuration options for the type constructor.
Returns
Cake\ElasticSearch\Index
remove() ¶ public static
remove(string $alias): void
Removes an instance from the registry.
Parameters
-
string
$alias The alias to remove.
Returns
void
set() ¶ public static
set(string $alias, Cake\ElasticSearch\Index $object): Cake\ElasticSearch\Index
Set an instance.
Parameters
-
string
$alias The alias to set.
-
Cake\ElasticSearch\Index
$object The type to set.
Returns
Cake\ElasticSearch\Index