ExtMongoDbResourceManager
in package
Resource manager for the ext-mongodb adapter.
If you are using ext-mongo, use the MongoDbResourceManager instead.
Table of Contents
- $resources : array<string|int, array<string|int, mixed>>
- Registered resources
- getCollection() : string
- getConnectionOptions() : array<string|int, mixed>
- getDatabase() : string
- getDriverOptions() : array<string|int, mixed>
- getResource() : Collection
- Instantiate and return the Collection resource
- getServer() : null|string
- hasResource() : bool
- Check if a resource exists
- setCollection() : void
- setConnectionOptions() : void
- setDatabase() : void
- setDriverOptions() : void
- setResource() : self
- Set a resource
- setServer() : void
Properties
$resources
Registered resources
private
array<string|int, array<string|int, mixed>>
$resources
= []
Methods
getCollection()
public
getCollection(string $id) : string
Parameters
- $id : string
Tags
Return values
string —getConnectionOptions()
public
getConnectionOptions(string $id) : array<string|int, mixed>
Parameters
- $id : string
Tags
Return values
array<string|int, mixed> —getDatabase()
public
getDatabase(string $id) : string
Parameters
- $id : string
Tags
Return values
string —getDriverOptions()
public
getDriverOptions(string $id) : array<string|int, mixed>
Parameters
- $id : string
Tags
Return values
array<string|int, mixed> —getResource()
Instantiate and return the Collection resource
public
getResource(string $id) : Collection
Parameters
- $id : string
Tags
Return values
Collection —getServer()
public
getServer(string $id) : null|string
Parameters
- $id : string
Tags
Return values
null|string —hasResource()
Check if a resource exists
public
hasResource(string $id) : bool
Parameters
- $id : string
Return values
bool —setCollection()
public
setCollection(string $id, string $collection) : void
Parameters
- $id : string
- $collection : string
Return values
void —setConnectionOptions()
public
setConnectionOptions(string $id, array<string|int, mixed> $connectionOptions) : void
Parameters
- $id : string
- $connectionOptions : array<string|int, mixed>
Return values
void —setDatabase()
public
setDatabase(string $id, string $database) : void
Parameters
- $id : string
- $database : string
Return values
void —setDriverOptions()
public
setDriverOptions(string $id, array<string|int, mixed> $driverOptions) : void
Parameters
- $id : string
- $driverOptions : array<string|int, mixed>
Return values
void —setResource()
Set a resource
public
setResource(string $id, array<string|int, mixed>|Collection $resource) : self
Parameters
- $id : string
- $resource : array<string|int, mixed>|Collection
Tags
Return values
self —Provides a fluent interface
setServer()
public
setServer(string $id, string $server) : void
Parameters
- $id : string
- $server : string