PHP Class LMongo\Connection

Afficher le fichier Open project: navruzm/lmongo Class Usage Examples

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
getDsn ( array $config ) : string Create a DSN string from a configuration.

Method Details

__get() public méthode

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

collection() public méthode

Return new Query Builder instance
public collection ( string $collection ) : Builder
$collection string
Résultat LMongo\Query\Builder

connect() public méthode

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

getCacheManager() public méthode

Get the cache manager instance.
public getCacheManager ( ) : Illuminate\Cache\CacheManager
Résultat Illuminate\Cache\CacheManager

getConfig() public méthode

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

getDsn() protected méthode

Create a DSN string from a configuration.
protected getDsn ( array $config ) : string
$config array
Résultat string

getEventDispatcher() public méthode

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

getMongoClient() public méthode

return MongoClient object
public getMongoClient ( ) : MongoClient
Résultat MongoClient

getMongoDB() public méthode

return MongoDB object
public getMongoDB ( ) : MongoDB
Résultat MongoDB

getName() public méthode

Get the database connection name.
public getName ( ) : string | null
Résultat string | null

getPaginator() public méthode

Get the paginator environment instance.
public getPaginator ( ) : Illuminate\Pagination\Environment
Résultat Illuminate\Pagination\Environment

setCacheManager() public méthode

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

setEventDispatcher() public méthode

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

setPaginator() public méthode

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

Property Details

$cache protected_oe property

The cache manager instance.
protected CacheManger,Illuminate\Cache $cache
Résultat Illuminate\Cache\CacheManger

$config protected_oe property

The database connection configuration options.
protected array $config
Résultat array

$connection protected_oe property

The MongoClient connection handler.
protected resource $connection
Résultat resource

$db protected_oe property

The MongoDB database handler.
protected resource $db
Résultat resource

$events protected_oe property

The event dispatcher instance.
protected Illuminate\Events\Dispatcher $events
Résultat Illuminate\Events\Dispatcher

$paginator protected_oe property

The paginator environment instance.
protected Illuminate\Pagination\Paginator $paginator
Résultat Illuminate\Pagination\Paginator