\MocaBonita\tools\eloquentMbConnectionResolver

Main class of the MocaBonita WpdbConnectionResolver

Summary

Methods
Properties
Constants
getInstance()
__clone()
__wakeup()
connection()
getDefaultConnection()
setDefaultConnection()
No public properties found
No constants found
__construct()
init()
$instances
$connectionName
N/A
No private methods found
No private properties found
N/A

Properties

$connectionName

$connectionName : string

Connection Name

Type

string

Methods

getInstance()

getInstance() : static

The singleton pattern is useful when we need to make sure that we only have a single instance of a class for the entire request lifecycle in a Web application. This usually occurs when we have global objects (such as a configuration class) or a resource (Such as an event queue).

Returns

static

__clone()

__clone() 

Clone Not allowed

Throws

\MocaBonita\tools\MbException

__wakeup()

__wakeup() 

WakeUp Not allowed.

Throws

\MocaBonita\tools\MbException

connection()

connection(string  $name = null) : \Illuminate\Database\ConnectionInterface

Get a database connection instance.

Parameters

string $name

Returns

\Illuminate\Database\ConnectionInterface

getDefaultConnection()

getDefaultConnection() : string

Get the default connection name.

Returns

string

setDefaultConnection()

setDefaultConnection(string  $name) : void

Set the default connection name.

Parameters

string $name

__construct()

__construct() 

Singleton construct

init()

init() 

Method to be started