PHP 클래스 Doctrine\MongoDB\Connection

부터: 1.0
저자: Jonathan H. Wage ([email protected])
파일 보기 프로젝트 열기: doctrine/mongodb 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$config Doctrine\MongoDB\Configuration The Configuration for this connection.
$driverOptions array Driver options used to construct the MongoClient instance (optional).
$eventManager Doctrine\Common\EventManager The EventManager used to dispatch events.
$mongoClient MongoClient The PHP MongoClient instance being wrapped.
$options array Options used to construct the MongoClient instance (optional).
$server string Server string used to construct the MongoClient instance (optional).

공개 메소드들

메소드 설명
__construct ( string | MongoClient $server = null, array $options = [], Doctrine\MongoDB\Configuration $config = null, Doctrine\Common\EventManager $evm = null, array $driverOptions = [] ) Constructor.
__get ( string $database ) : MongoDB Wrapper method for MongoClient::__get().
__toString ( ) : string Wrapper method for MongoClient::__toString().
close ( ) : boolean Wrapper method for MongoClient::close().
connect ( ) : boolean Wrapper method for MongoClient::connect().
dropDatabase ( string $database ) : array Wrapper method for MongoClient::dropDB().
getConfiguration ( ) : Doctrine\MongoDB\Configuration Get the Configuration used by this Connection.
getEventManager ( ) : Doctrine\Common\EventManager Get the EventManager used by this Connection.
getMongo ( ) : MongoClient Get the MongoClient instance being wrapped.
getMongoClient ( ) : MongoClient Get the MongoClient instance being wrapped.
getReadPreference ( ) : array Wrapper method for MongoClient::getReadPreference().
getServer ( ) : string | null Get the server string.
getStatus ( ) : string Gets the $status property of the wrapped MongoClient instance.
initialize ( ) Construct the wrapped MongoClient instance if necessary.
isConnected ( ) : boolean Checks whether the connection is initialized and connected.
listDatabases ( ) : array Wrapper method for MongoClient::listDBs().
log ( array $log ) Log something using the configured logger callable (if available).
selectCollection ( string $db, string $collection ) : Doctrine\MongoDB\Collection Wrapper method for MongoClient::selectCollection().
selectDatabase ( string $name ) : Doctrine\MongoDB\Database Wrapper method for MongoClient::selectDatabase().
setMongo ( MongoClient $mongoClient ) Set the MongoClient instance to wrap.
setReadPreference ( string $readPreference, array $tags = null ) : boolean Wrapper method for MongoClient::setReadPreference().

보호된 메소드들

메소드 설명
convertConnectTimeout ( array $options ) : array Converts "timeout" MongoClient constructor option to "connectTimeoutMS" for driver versions 1.4.0+.
convertWriteTimeout ( array $options ) : array Converts "wTimeout" MongoClient constructor option to "wTimeoutMS" for driver versions 1.4.0+.
doSelectDatabase ( string $name ) : Doctrine\MongoDB\Database Return a new Database instance.
retry ( Closure $retry ) : mixed Conditionally retry a closure if it yields an exception.

메소드 상세

__construct() 공개 메소드

If $server is an existing MongoClient instance, the $options parameter will not be used.
public __construct ( string | MongoClient $server = null, array $options = [], Doctrine\MongoDB\Configuration $config = null, Doctrine\Common\EventManager $evm = null, array $driverOptions = [] )
$server string | MongoClient Server string or MongoClient instance
$options array MongoClient constructor options
$config Doctrine\MongoDB\Configuration Configuration instance
$evm Doctrine\Common\EventManager EventManager instance
$driverOptions array MongoClient constructor options

__get() 공개 메소드

Wrapper method for MongoClient::__get().
또한 보기: http://php.net/manual/en/mongoclient.get.php
public __get ( string $database ) : MongoDB
$database string
리턴 MongoDB

__toString() 공개 메소드

Wrapper method for MongoClient::__toString().
또한 보기: http://php.net/manual/en/mongoclient.tostring.php
public __toString ( ) : string
리턴 string

close() 공개 메소드

Wrapper method for MongoClient::close().
또한 보기: http://php.net/manual/en/mongoclient.close.php
public close ( ) : boolean
리턴 boolean

connect() 공개 메소드

Wrapper method for MongoClient::connect().
또한 보기: http://php.net/manual/en/mongoclient.connect.php
public connect ( ) : boolean
리턴 boolean

convertConnectTimeout() 보호된 메소드

Note: MongoClient actually allows case-insensitive option names, but we'll only process the canonical version here.
protected convertConnectTimeout ( array $options ) : array
$options array
리턴 array

convertWriteTimeout() 보호된 메소드

Note: MongoClient actually allows case-insensitive option names, but we'll only process the canonical version here.
protected convertWriteTimeout ( array $options ) : array
$options array
리턴 array

doSelectDatabase() 보호된 메소드

If a logger callable was defined, a LoggableDatabase will be returned.
또한 보기: Connection::selectDatabase()
protected doSelectDatabase ( string $name ) : Doctrine\MongoDB\Database
$name string
리턴 Doctrine\MongoDB\Database

dropDatabase() 공개 메소드

This method will dispatch preDropDatabase and postDropDatabase events.
또한 보기: http://php.net/manual/en/mongoclient.dropdb.php
public dropDatabase ( string $database ) : array
$database string
리턴 array

getConfiguration() 공개 메소드

Get the Configuration used by this Connection.
public getConfiguration ( ) : Doctrine\MongoDB\Configuration
리턴 Doctrine\MongoDB\Configuration

getEventManager() 공개 메소드

Get the EventManager used by this Connection.
public getEventManager ( ) : Doctrine\Common\EventManager
리턴 Doctrine\Common\EventManager

getMongo() 공개 메소드

Get the MongoClient instance being wrapped.
사용 중단: 1.1 Replaced by getMongoClient(); will be removed for 2.0
public getMongo ( ) : MongoClient
리턴 MongoClient

getMongoClient() 공개 메소드

Get the MongoClient instance being wrapped.
public getMongoClient ( ) : MongoClient
리턴 MongoClient

getReadPreference() 공개 메소드

For driver versions between 1.3.0 and 1.3.3, the return value will be converted for consistency with {@link Connection::setReadPreference()}.
또한 보기: http://php.net/manual/en/mongoclient.getreadpreference.php
public getReadPreference ( ) : array
리턴 array

getServer() 공개 메소드

Get the server string.
public getServer ( ) : string | null
리턴 string | null

getStatus() 공개 메소드

Gets the $status property of the wrapped MongoClient instance.
사용 중단: 1.1 No longer used in driver; Will be removed for 1.2
public getStatus ( ) : string
리턴 string

initialize() 공개 메소드

This method will dispatch preConnect and postConnect events.
public initialize ( )

isConnected() 공개 메소드

Checks whether the connection is initialized and connected.
public isConnected ( ) : boolean
리턴 boolean

listDatabases() 공개 메소드

Wrapper method for MongoClient::listDBs().
또한 보기: http://php.net/manual/en/mongoclient.listdbs.php
public listDatabases ( ) : array
리턴 array

log() 공개 메소드

Log something using the configured logger callable (if available).
public log ( array $log )
$log array

retry() 보호된 메소드

If the closure does not return successfully within the configured number of retries, its first exception will be thrown.
protected retry ( Closure $retry ) : mixed
$retry Closure
리턴 mixed

selectCollection() 공개 메소드

Wrapper method for MongoClient::selectCollection().
또한 보기: http://php.net/manual/en/mongoclient.selectcollection.php
public selectCollection ( string $db, string $collection ) : Doctrine\MongoDB\Collection
$db string
$collection string
리턴 Doctrine\MongoDB\Collection

selectDatabase() 공개 메소드

This method will dispatch preSelectDatabase and postSelectDatabase events.
또한 보기: http://php.net/manual/en/mongoclient.selectdatabase.php
public selectDatabase ( string $name ) : Doctrine\MongoDB\Database
$name string
리턴 Doctrine\MongoDB\Database

setMongo() 공개 메소드

Set the MongoClient instance to wrap.
사용 중단: 1.1 Will be removed for 2.0
public setMongo ( MongoClient $mongoClient )
$mongoClient MongoClient

setReadPreference() 공개 메소드

Wrapper method for MongoClient::setReadPreference().
또한 보기: http://php.net/manual/en/mongoclient.setreadpreference.php
public setReadPreference ( string $readPreference, array $tags = null ) : boolean
$readPreference string
$tags array
리턴 boolean

프로퍼티 상세

$config 보호되어 있는 프로퍼티

The Configuration for this connection.
protected Configuration,Doctrine\MongoDB $config
리턴 Doctrine\MongoDB\Configuration

$driverOptions 보호되어 있는 프로퍼티

Driver options used to construct the MongoClient instance (optional).
protected array $driverOptions
리턴 array

$eventManager 보호되어 있는 프로퍼티

The EventManager used to dispatch events.
protected EventManager,Doctrine\Common $eventManager
리턴 Doctrine\Common\EventManager

$mongoClient 보호되어 있는 프로퍼티

The PHP MongoClient instance being wrapped.
protected MongoClient $mongoClient
리턴 MongoClient

$options 보호되어 있는 프로퍼티

Options used to construct the MongoClient instance (optional).
protected array $options
리턴 array

$server 보호되어 있는 프로퍼티

Server string used to construct the MongoClient instance (optional).
protected string $server
리턴 string