PHP Класс Phalcon\Db\Adapter\MongoDB\Database

Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( MongoDB\Driver\Manager $manager, string $databaseName, array $options = [] ) Constructs new Database instance.
__debugInfo ( ) : array Return internal properties for debugging purposes.
__get ( string $collectionName ) : Collection Select a collection within this database.
__toString ( ) : string Return the database name.
command ( array | object $command, array $options = [] ) : MongoDB\Driver\Cursor Execute a command on this database.
createCollection ( string $collectionName, array $options = [] ) : array | object Create a new collection explicitly.
drop ( array $options = [] ) : array | object Drop this database.
dropCollection ( string $collectionName, array $options = [] ) : array | object Drop a collection within this database.
getDatabaseName ( ) : string Returns the database name.
listCollections ( array $options = [] ) : Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator Returns information for all collections in this database.
selectCollection ( string $collectionName, array $options = [] ) : Collection Select a collection within this database.
withOptions ( array $options = [] ) : Database Get a clone of this database with different options.

Описание методов

__construct() публичный Метод

This class provides methods for database-specific operations and serves as a gateway for accessing collections. Supported options: * readConcern (MongoDB\Driver\ReadConcern): The default read concern to use for database operations and selected collections. Defaults to the Manager's read concern. * readPreference (MongoDB\Driver\ReadPreference): The default read preference to use for database operations and selected collections. Defaults to the Manager's read preference. * typeMap (array): Default type map for cursors and BSON documents. * writeConcern (MongoDB\Driver\WriteConcern): The default write concern to use for database operations and selected collections. Defaults to the Manager's write concern.
public __construct ( MongoDB\Driver\Manager $manager, string $databaseName, array $options = [] )
$manager MongoDB\Driver\Manager Manager instance from the driver
$databaseName string Database name
$options array Database options

__debugInfo() публичный Метод

Return internal properties for debugging purposes.
См. также: http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.debuginfo
public __debugInfo ( ) : array
Результат array

__get() публичный Метод

Note: collections whose names contain special characters (e.g. ".") may be selected with complex syntax (e.g. $database->{"system.profile"}) or {@link selectCollection()}.
См. также: http://php.net/oop5.overloading#object.get
См. также: http://php.net/types.string#language.types.string.parsing.complex
public __get ( string $collectionName ) : Collection
$collectionName string Name of the collection to select
Результат Collection

__toString() публичный Метод

Return the database name.
public __toString ( ) : string
Результат string

command() публичный Метод

Execute a command on this database.
См. также: DatabaseCommand::__construct() for supported options
public command ( array | object $command, array $options = [] ) : MongoDB\Driver\Cursor
$command array | object Command document
$options array Options for command execution
Результат MongoDB\Driver\Cursor

createCollection() публичный Метод

Create a new collection explicitly.
См. также: CreateCollection::__construct() for supported options
public createCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string
$options array
Результат array | object Command result document

drop() публичный Метод

Drop this database.
См. также: DropDatabase::__construct() for supported options
public drop ( array $options = [] ) : array | object
$options array Additional options
Результат array | object Command result document

dropCollection() публичный Метод

Drop a collection within this database.
См. также: DropCollection::__construct() for supported options
public dropCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string Collection name
$options array Additional options
Результат array | object Command result document

getDatabaseName() публичный Метод

Returns the database name.
public getDatabaseName ( ) : string
Результат string

listCollections() публичный Метод

Returns information for all collections in this database.
См. также: ListCollections::__construct() for supported options
public listCollections ( array $options = [] ) : Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator
$options array
Результат Phalcon\Db\Adapter\MongoDB\Model\CollectionInfoIterator

selectCollection() публичный Метод

Select a collection within this database.
См. также: Collection::__construct() for supported options
public selectCollection ( string $collectionName, array $options = [] ) : Collection
$collectionName string Name of the collection to select
$options array Collection constructor options
Результат Collection

withOptions() публичный Метод

Get a clone of this database with different options.
См. также: Database::__construct() for supported options
public withOptions ( array $options = [] ) : Database
$options array Database constructor options
Результат Database