PHP Class Cake\ElasticSearch\TypeRegistry

Handles ensuring only one instance of each type is created and that the correct connection is injected in. Provides an interface similar to Cake\ORM\TableRegistry.
Afficher le fichier Open project: cakephp/elastic-search Class Usage Examples

Protected Properties

Свойство Type Description
$instances array The map of instances in the registry.
$options array List of options by alias passed to get.

Méthodes publiques

Méthode Description
clear ( ) : void Clears the registry of configuration and instances.
exists ( string $alias ) : boolean Check to see if an instance exists in the registry.
get ( string $alias, array $options = [] ) : Type Get/Create an instance from the registry.
remove ( string $alias ) : void Removes an instance from the registry.
set ( string $alias, Type $object ) : Type Set an instance.

Method Details

clear() public static méthode

Clears the registry of configuration and instances.
public static clear ( ) : void
Résultat void

exists() public static méthode

Check to see if an instance exists in the registry.
public static exists ( string $alias ) : boolean
$alias string The alias to check for.
Résultat boolean

get() public static méthode

When getting an instance, if it does not already exist, a new instance will be created using the provide alias, and options.
public static get ( string $alias, array $options = [] ) : Type
$alias string The name of the alias to get.
$options array Configuration options for the type constructor.
Résultat Type

remove() public static méthode

Removes an instance from the registry.
public static remove ( string $alias ) : void
$alias string The alias to remove.
Résultat void

set() public static méthode

Set an instance.
public static set ( string $alias, Type $object ) : Type
$alias string The alias to set.
$object Type The type to set.
Résultat Type

Property Details

$instances protected_oe static_oe property

The map of instances in the registry.
protected static array $instances
Résultat array

$options protected_oe static_oe property

List of options by alias passed to get.
protected static array $options
Résultat array