PHP Class Cake\ElasticSearch\Datasource\Connection

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

Protected Properties

Property Type Description
$configName string The connection name in the connection manager.
$logQueries boolean Whether or not query logging is enabled.

Public Methods

Method 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}

Protected Methods

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

Method Details

__construct() public method

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 method

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

beginTransaction() public method

{@inheritDoc}
public beginTransaction ( )

config() public method

Get the config data for this connection.
public config ( ) : array
return array

configName() public method

{@inheritDoc}
public configName ( )

disableConstraints() public method

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 method

{@inheritDoc}
public disableForeignKeys ( )

enableForeignKeys() public method

{@inheritDoc}
public enableForeignKeys ( )

enabled() public method

{@inheritDoc}
public enabled ( )

getIndex() public method

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.
return Elastica\Index Index for the given name

logQueries() public method

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

logger() public method

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
return object logger instance

schemaCollection() public method

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

transactional() public method

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

Property Details

$configName protected_oe property

The connection name in the connection manager.
protected string $configName
return string

$logQueries protected_oe property

Whether or not query logging is enabled.
protected bool $logQueries
return boolean