PHP Class LMongo\Connection

Datei anzeigen Open project: navruzm/lmongo Class Usage Examples

Protected Properties

Property Type Description
$cache Illuminate\Cache\CacheManger The cache manager instance.
$config array The database connection configuration options.
$connection resource The MongoClient connection handler.
$db resource The MongoDB database handler.
$events Illuminate\Events\Dispatcher The event dispatcher instance.
$paginator Illuminate\Pagination\Paginator The paginator environment instance.

Public Methods

Method Description
__get ( string $name ) : MongoCollection Dynamically pass collection name to MongoCollection and return it.
collection ( string $collection ) : Builder Return new Query Builder instance
connect ( array $config ) : LMongo\Connection Establish a database connection.
getCacheManager ( ) : Illuminate\Cache\CacheManager Get the cache manager instance.
getConfig ( string $option ) : mixed Get an option from the configuration options.
getEventDispatcher ( ) : Illuminate\Events\Dispatcher Get the event dispatcher used by the connection.
getMongoClient ( ) : MongoClient return MongoClient object
getMongoDB ( ) : MongoDB return MongoDB object
getName ( ) : string | null Get the database connection name.
getPaginator ( ) : Illuminate\Pagination\Environment Get the paginator environment instance.
setCacheManager ( Illuminate\Cache\CacheManager | Closure $cache ) : void Set the cache manager instance on the connection.
setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void Set the event dispatcher instance on the connection.
setPaginator ( Illuminate\Pagination\Environment | Closure $paginator ) : void Set the pagination environment instance.

Protected Methods

Method Description
getDsn ( array $config ) : string Create a DSN string from a configuration.

Method Details

__get() public method

Dynamically pass collection name to MongoCollection and return it.
public __get ( string $name ) : MongoCollection
$name string
return MongoCollection

collection() public method

Return new Query Builder instance
public collection ( string $collection ) : Builder
$collection string
return LMongo\Query\Builder

connect() public method

Establish a database connection.
public connect ( array $config ) : LMongo\Connection
$config array
return LMongo\Connection

getCacheManager() public method

Get the cache manager instance.
public getCacheManager ( ) : Illuminate\Cache\CacheManager
return Illuminate\Cache\CacheManager

getConfig() public method

Get an option from the configuration options.
public getConfig ( string $option ) : mixed
$option string
return mixed

getDsn() protected method

Create a DSN string from a configuration.
protected getDsn ( array $config ) : string
$config array
return string

getEventDispatcher() public method

Get the event dispatcher used by the connection.
public getEventDispatcher ( ) : Illuminate\Events\Dispatcher
return Illuminate\Events\Dispatcher

getMongoClient() public method

return MongoClient object
public getMongoClient ( ) : MongoClient
return MongoClient

getMongoDB() public method

return MongoDB object
public getMongoDB ( ) : MongoDB
return MongoDB

getName() public method

Get the database connection name.
public getName ( ) : string | null
return string | null

getPaginator() public method

Get the paginator environment instance.
public getPaginator ( ) : Illuminate\Pagination\Environment
return Illuminate\Pagination\Environment

setCacheManager() public method

Set the cache manager instance on the connection.
public setCacheManager ( Illuminate\Cache\CacheManager | Closure $cache ) : void
$cache Illuminate\Cache\CacheManager | Closure
return void

setEventDispatcher() public method

Set the event dispatcher instance on the connection.
public setEventDispatcher ( Illuminate\Events\Dispatcher $events ) : void
$events Illuminate\Events\Dispatcher
return void

setPaginator() public method

Set the pagination environment instance.
public setPaginator ( Illuminate\Pagination\Environment | Closure $paginator ) : void
$paginator Illuminate\Pagination\Environment | Closure
return void

Property Details

$cache protected_oe property

The cache manager instance.
protected CacheManger,Illuminate\Cache $cache
return Illuminate\Cache\CacheManger

$config protected_oe property

The database connection configuration options.
protected array $config
return array

$connection protected_oe property

The MongoClient connection handler.
protected resource $connection
return resource

$db protected_oe property

The MongoDB database handler.
protected resource $db
return resource

$events protected_oe property

The event dispatcher instance.
protected Illuminate\Events\Dispatcher $events
return Illuminate\Events\Dispatcher

$paginator protected_oe property

The paginator environment instance.
protected Illuminate\Pagination\Paginator $paginator
return Illuminate\Pagination\Paginator