Manager
in package
Uses
CapsuleManagerTrait
Table of Contents
- $container : Container
- The container instance.
- $instance : object
- The current globally used instance.
- $manager : DatabaseManager
- The database manager instance.
- __callStatic() : mixed
- Dynamically pass methods to the default connection.
- __construct() : void
- Create a new database capsule manager.
- addConnection() : void
- Register a connection with the manager.
- bootEloquent() : void
- Bootstrap Eloquent so it is ready for usage.
- connection() : Connection
- Get a connection instance from the global manager.
- getConnection() : Connection
- Get a registered connection instance.
- getContainer() : Container
- Get the IoC container instance.
- getDatabaseManager() : DatabaseManager
- Get the database manager instance.
- getEventDispatcher() : Dispatcher|null
- Get the current event dispatcher instance.
- schema() : Builder
- Get a schema builder instance.
- setAsGlobal() : void
- Make this capsule instance available globally.
- setContainer() : void
- Set the IoC container instance.
- setEventDispatcher() : void
- Set the event dispatcher instance to be used by connections.
- setFetchMode() : $this
- Set the fetch mode for the database connections.
- table() : Builder
- Get a fluent query builder instance.
- setupContainer() : void
- Setup the IoC container instance.
- setupDefaultConfiguration() : void
- Setup the default database configuration options.
- setupManager() : void
- Build the database manager instance.
Properties
$container
The container instance.
protected
Container
$container
$instance
The current globally used instance.
protected
static object
$instance
$manager
The database manager instance.
protected
DatabaseManager
$manager
Methods
__callStatic()
Dynamically pass methods to the default connection.
public
static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__construct()
Create a new database capsule manager.
public
__construct([Container|null $container = null ]) : void
Parameters
- $container : Container|null = null
Return values
void —addConnection()
Register a connection with the manager.
public
addConnection(array<string|int, mixed> $config[, string $name = 'default' ]) : void
Parameters
- $config : array<string|int, mixed>
- $name : string = 'default'
Return values
void —bootEloquent()
Bootstrap Eloquent so it is ready for usage.
public
bootEloquent() : void
Return values
void —connection()
Get a connection instance from the global manager.
public
static connection([string $connection = null ]) : Connection
Parameters
- $connection : string = null
Return values
Connection —getConnection()
Get a registered connection instance.
public
getConnection([string $name = null ]) : Connection
Parameters
- $name : string = null
Return values
Connection —getContainer()
Get the IoC container instance.
public
getContainer() : Container
Return values
Container —getDatabaseManager()
Get the database manager instance.
public
getDatabaseManager() : DatabaseManager
Return values
DatabaseManager —getEventDispatcher()
Get the current event dispatcher instance.
public
getEventDispatcher() : Dispatcher|null
Return values
Dispatcher|null —schema()
Get a schema builder instance.
public
static schema([string $connection = null ]) : Builder
Parameters
- $connection : string = null
Return values
Builder —setAsGlobal()
Make this capsule instance available globally.
public
setAsGlobal() : void
Return values
void —setContainer()
Set the IoC container instance.
public
setContainer(Container $container) : void
Parameters
- $container : Container
Return values
void —setEventDispatcher()
Set the event dispatcher instance to be used by connections.
public
setEventDispatcher(Dispatcher $dispatcher) : void
Parameters
- $dispatcher : Dispatcher
Return values
void —setFetchMode()
Set the fetch mode for the database connections.
public
setFetchMode(int $fetchMode) : $this
Parameters
- $fetchMode : int
Return values
$this —table()
Get a fluent query builder instance.
public
static table(string $table[, string $connection = null ]) : Builder
Parameters
- $table : string
- $connection : string = null
Return values
Builder —setupContainer()
Setup the IoC container instance.
protected
setupContainer(Container $container) : void
Parameters
- $container : Container
Return values
void —setupDefaultConfiguration()
Setup the default database configuration options.
protected
setupDefaultConfiguration() : void
Return values
void —setupManager()
Build the database manager instance.
protected
setupManager() : void