CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C Elastic Search 4.x API

  • Project:
    • Elastic Search
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.x
      • 4.x
      • 3.x
      • 2.x

Namespaces

  • Cake\ElasticSearch
    • Association
    • Datasource
      • Log
    • Exception
    • Rule
    • TestSuite
    • View

Class IndexLocator

Datasource FactoryLocator compatible locater implementation.

Namespace: Cake\ElasticSearch\Datasource

Property Summary

  • $allowFallbackClass protected
    bool

    Whether fallback class should be used if a Index class could not be found.

  • $fallbackClassName protected
    string

    Fallback class to use

  • $instances protected
    array<string, \Cake\Datasource\RepositoryInterface>

    Instances that belong to the registry.

  • $options protected
    array<string, array>

    Contains a list of options that were passed to get() method.

Method Summary

  • allowFallbackClass() public

    Set if fallback class should be used.

  • clear() public

    Clears the registry of configuration and instances.

  • createInstance() protected

    Create an instance of a given classname.

  • exists() public

    Check to see if an instance exists in the registry.

  • get() public

    Get a repository instance from the registry.

  • remove() public

    Removes an repository instance from the registry.

  • set() public

    Set a repository instance.

  • setFallbackClassName() public

    Set fallback class name.

Method Detail

allowFallbackClass() ¶ public

allowFallbackClass(bool $allow): $this

Set if fallback class should be used.

Controls whether a fallback class should be used to create a index instance if a concrete class for alias used in get() could not be found.

Parameters
bool $allow

Flag to enable or disable fallback

Returns
$this

clear() ¶ public

clear(): void

Clears the registry of configuration and instances.

Returns
void

createInstance() ¶ protected

createInstance(string $alias, array<string, mixed> $options): Cake\Datasource\RepositoryInterface

Create an instance of a given classname.

Parameters
string $alias
array<string, mixed> $options
Returns
Cake\Datasource\RepositoryInterface

exists() ¶ public

exists(string $alias): bool

Check to see if an instance exists in the registry.

Parameters
string $alias
Returns
bool

get() ¶ public

get(string $alias, array<string, mixed> $options = []): Cake\Datasource\RepositoryInterface

Get a repository instance from the registry.

Parameters
string $alias

The alias name you want to get.

array<string, mixed> $options optional

The options you want to build the table with.

Returns
Cake\Datasource\RepositoryInterface
Throws
Cake\Core\Exception\CakeException
When trying to get alias for which instance has already been created with different options.

remove() ¶ public

remove(string $alias): void

Removes an repository instance from the registry.

Parameters
string $alias
Returns
void

set() ¶ public

set(string $alias, Cake\Datasource\RepositoryInterface $repository): Cake\Datasource\RepositoryInterface

Set a repository instance.

Parameters
string $alias
Cake\Datasource\RepositoryInterface $repository
Returns
Cake\Datasource\RepositoryInterface

setFallbackClassName() ¶ public

setFallbackClassName(string $className): $this

Set fallback class name.

The class that should be used to create a table 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
$this

Property Detail

$allowFallbackClass ¶ protected

Whether fallback class should be used if a Index class could not be found.

Type
bool

$fallbackClassName ¶ protected

Fallback class to use

Type
string

$instances ¶ protected

Instances that belong to the registry.

Type
array<string, \Cake\Datasource\RepositoryInterface>

$options ¶ protected

Contains a list of options that were passed to get() method.

Type
array<string, array>
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs