PHP Class Cake\ElasticSearch\Datasource\Connection

Inheritance: extends Elastica\Client, implements Cake\Datasource\ConnectionInterface
Afficher le fichier Open project: cakephp/elastic-search Class Usage Examples

Protected Properties

Свойство Type Description
$configName string The connection name in the connection manager.
$logQueries boolean Whether or not query logging is enabled.

Méthodes publiques

Méthode Description
__construct ( array $config = [], callback $callback = null ) Constructor. Appends the default index name to the config array, which by default is _all
beginTransaction ( ) {@inheritDoc}
config ( ) : array Get the config data for this connection.
configName ( ) {@inheritDoc}
disableConstraints ( callable $callback ) {@inheritDoc}
disableForeignKeys ( ) {@inheritDoc}
enableForeignKeys ( ) {@inheritDoc}
enabled ( ) {@inheritDoc}
getIndex ( string $name = null ) : Index Returns the index for the given connection
logQueries ( $enable = null ) {@inheritDoc}
logger ( object $instance = null ) : object Sets the logger object instance. When called with no arguments it returns the currently setup logger instance.
schemaCollection ( ) : SchemaCollection Returns a SchemaCollection stub until we can add more abstract API's in Connection.
transactional ( callable $callable ) {@inheritDoc}

Méthodes protégées

Méthode Description
_log ( Request | array $context ) : void Log requests to Elastic Search.

Method Details

__construct() public méthode

Constructor. Appends the default index name to the config array, which by default is _all
public __construct ( array $config = [], callback $callback = null )
$config array config options
$callback callback Callback function which can be used to be notified about errors (for example connection down)

_log() protected méthode

Log requests to Elastic Search.
protected _log ( Request | array $context ) : void
$context Elastica\Request | array The context of the request made.
Résultat void

beginTransaction() public méthode

{@inheritDoc}
public beginTransaction ( )

config() public méthode

Get the config data for this connection.
public config ( ) : array
Résultat array

configName() public méthode

{@inheritDoc}
public configName ( )

disableConstraints() public méthode

Elasticsearch does not deal with the concept of foreign key constraints This method just triggers the $callback argument.
public disableConstraints ( callable $callback )
$callback callable

disableForeignKeys() public méthode

{@inheritDoc}
public disableForeignKeys ( )

enableForeignKeys() public méthode

{@inheritDoc}
public enableForeignKeys ( )

enabled() public méthode

{@inheritDoc}
public enabled ( )

getIndex() public méthode

Returns the index for the given connection
public getIndex ( string $name = null ) : Index
$name string Index name to create connection to, if no value is passed it will use the default index name for the connection.
Résultat Elastica\Index Index for the given name

logQueries() public méthode

{@inheritDoc}
public logQueries ( $enable = null )

logger() public méthode

Sets the logger object instance. When called with no arguments it returns the currently setup logger instance.
public logger ( object $instance = null ) : object
$instance object logger object instance
Résultat object logger instance

schemaCollection() public méthode

Returns a SchemaCollection stub until we can add more abstract API's in Connection.
public schemaCollection ( ) : SchemaCollection
Résultat SchemaCollection

transactional() public méthode

{@inheritDoc}
public transactional ( callable $callable )
$callable callable

Property Details

$configName protected_oe property

The connection name in the connection manager.
protected string $configName
Résultat string

$logQueries protected_oe property

Whether or not query logging is enabled.
protected bool $logQueries
Résultat boolean