PHP Class Cviebrock\LaravelElasticsearch\Manager

Show file Open project: cviebrock/laravel-elasticsearch Class Usage Examples

Protected Properties

Property Type Description
$app Illuminate\Contracts\Foundation\Application The application instance.
$connections array The active connection instances.
$factory Factory The Elasticsearch connection factory instance.

Public Methods

Method Description
__call ( string $method, array $parameters ) : mixed Dynamically pass methods to the default connection.
__construct ( Illuminate\Contracts\Foundation\Application $app, Factory $factory )
connection ( null $name = null ) : Elasticsearch\Client | mixed Retrieve or build the named connection.
getConnections ( ) : array Return all of the created connections.
getDefaultConnection ( ) : string Get the default connection.
setDefaultConnection ( string $connection ) Set the default connection.

Protected Methods

Method Description
getConfig ( $name ) : mixed Get the configuration for a named connection.
makeConnection ( $name ) : Elasticsearch\Client | mixed Make a new connection.

Method Details

__call() public method

Dynamically pass methods to the default connection.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
return mixed

__construct() public method

public __construct ( Illuminate\Contracts\Foundation\Application $app, Factory $factory )
$app Illuminate\Contracts\Foundation\Application
$factory Factory

connection() public method

Retrieve or build the named connection.
public connection ( null $name = null ) : Elasticsearch\Client | mixed
$name null
return Elasticsearch\Client | mixed

getConfig() protected method

Get the configuration for a named connection.
protected getConfig ( $name ) : mixed
$name
return mixed

getConnections() public method

Return all of the created connections.
public getConnections ( ) : array
return array

getDefaultConnection() public method

Get the default connection.
public getDefaultConnection ( ) : string
return string

makeConnection() protected method

Make a new connection.
protected makeConnection ( $name ) : Elasticsearch\Client | mixed
$name
return Elasticsearch\Client | mixed

setDefaultConnection() public method

Set the default connection.
public setDefaultConnection ( string $connection )
$connection string

Property Details

$app protected property

The application instance.
protected Application,Illuminate\Contracts\Foundation $app
return Illuminate\Contracts\Foundation\Application

$connections protected property

The active connection instances.
protected array $connections
return array

$factory protected property

The Elasticsearch connection factory instance.
protected Factory,Cviebrock\LaravelElasticsearch $factory
return Factory