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.
Deprecated: 3.4.3 Statically accesible registry is deprecated. Prefer using `IndexLocator` alongside the `LocatorTrait` in CakePHP.
Property Summary
-
$locator protected static
Cake\ElasticSearch\Cake\ElasticSearch\Datasource\IndexLocator
The locator that the global registy is wrapping.
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.
-
getLocator() protected static
Get the wrapped locator.
-
remove() public static
Removes an instance from the registry.
-
set() public static
Set an instance.
-
setFallbackClassName() public static
Set fallback class name.
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
getLocator() ¶ protected static
getLocator(): Cake\ElasticSearch\IndexLocator
Get the wrapped locator.
Returns
Cake\ElasticSearch\IndexLocator
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
setFallbackClassName() ¶ public static
setFallbackClassName(string $className): void
Set fallback class name.
The class that should be used to create a index instance if a concrete
class for alias used in get()
could not be found. Defaults to
Cake\ElasticSearch\Index
.
Parameters
-
string
$className Fallback class name
Returns
void
Property Detail
$locator ¶ protected static
The locator that the global registy is wrapping.
Type
Cake\ElasticSearch\Cake\ElasticSearch\Datasource\IndexLocator