Méthode | Description | |
---|---|---|
__construct ( string $dsn = null, array $options = null ) | ||
__get ( $name ) | ||
createPersistence ( ) : Sokil\Mongo\Persistence | Create new persistence manager | |
debug ( $enabled = true ) | Enable or disable debug mode | |
getCollection ( string $name ) : |
Get collection from previously selected database by self::useDatabase() | |
getConnectOptions ( ) | ||
getConnections ( ) : array | Get list of all active connections through this client | |
getCurrentDatabaseName ( ) : string | Get name of current database | |
getDatabase ( string $name = null ) : |
Get database instance | |
getDbVersion ( ) : string | ||
getDsn ( ) | ||
getLogger ( ) : Psr\Log\LoggerInterface | ||
getMongoClient ( ) : MongoClient | Get mongo connection instance | |
getReadPreference ( ) | ||
getVersion ( ) : string | ||
getWriteConcern ( ) : string | integer | Get currently active write concern on connection level | |
hasLogger ( ) : boolean | Check if logger defined | |
isDebugEnabled ( ) | Check state of debug mode | |
map ( array $mapping ) : |
Map database and collection name to class. | |
readNearest ( array $tags = null ) | ||
readPrimaryOnly ( ) | ||
readPrimaryPreferred ( array $tags = null ) | ||
readSecondaryOnly ( array $tags = null ) | ||
readSecondaryPreferred ( array $tags = null ) | ||
removeLogger ( ) : |
Remove logger | |
setConnectOptions ( array $options ) : |
Set connect options | |
setCredentials ( type $username, type $password ) : |
Set credentials to auth on db, specified in connect options or dsn. | |
setDsn ( $dsn ) | ||
setLogger ( Psr\Log\LoggerInterface $logger ) | ||
setMajorityWriteConcern ( integer $timeout = 10000 ) : |
Define majority write concern on whole requests | |
setMongoClient ( MongoClient $client ) : |
Set mongo's client | |
setUnacknowledgedWriteConcern ( integer $timeout = 10000 ) : |
Define unacknowledged write concern on whole requests | |
setWriteConcern ( string | integer $w, integer $timeout = 10000 ) : |
Define write concern on whole requests | |
useDatabase ( string $name ) : |
Select database |
public __construct ( string $dsn = null, array $options = null ) | ||
$dsn | string | Data Source Name |
$options | array |
public createPersistence ( ) : Sokil\Mongo\Persistence | ||
Résultat | Sokil\Mongo\Persistence |
public getCollection ( string $name ) : |
||
$name | string | |
Résultat |
public getConnections ( ) : array | ||
Résultat | array |
public getCurrentDatabaseName ( ) : string | ||
Résultat | string |
public getDatabase ( string $name = null ) : |
||
$name | string | database name |
Résultat |
public getDbVersion ( ) : string | ||
Résultat | string | version of mongo database |
public getLogger ( ) : Psr\Log\LoggerInterface | ||
Résultat | Psr\Log\LoggerInterface |
public getMongoClient ( ) : MongoClient | ||
Résultat | MongoClient |
public getWriteConcern ( ) : string | integer | ||
Résultat | string | integer |
public readPrimaryPreferred ( array $tags = null ) | ||
$tags | array |
public readSecondaryPreferred ( array $tags = null ) | ||
$tags | array |
public setConnectOptions ( array $options ) : |
||
$options | array | |
Résultat |
public setCredentials ( type $username, type $password ) : |
||
$username | type | |
$password | type | |
Résultat |
public setLogger ( Psr\Log\LoggerInterface $logger ) | ||
$logger | Psr\Log\LoggerInterface |
public setMajorityWriteConcern ( integer $timeout = 10000 ) : |
||
$timeout | integer | timeout in milliseconds |
Résultat |
public setMongoClient ( MongoClient $client ) : |
||
$client | MongoClient | |
Résultat |
public setUnacknowledgedWriteConcern ( integer $timeout = 10000 ) : |
||
$timeout | integer | timeout in milliseconds |
Résultat |
public useDatabase ( string $name ) : |
||
$name | string | |
Résultat |