PHP Class MongoLite\Database

Mostra file Open project: aheinze/mongo-lite

Public Properties

Property Type Description
$connection object

Protected Properties

Property Type Description
$collections array
$document_criterias array
$path string

Public Methods

Method Description
__construct ( string $path = ":memory:", array $options = [] ) Constructor
__get ( $collection )
callCriteriaFunction ( string $id, array $document ) : boolean Execute registred criteria function
createCollection ( string $name ) Create a collection
drop ( ) Drop database
dropCollection ( string $name ) Drop a collection
getCollectionNames ( ) : array Get all collection names in the database
listCollections ( ) : array Get all collections in the database
registerCriteriaFunction ( mixed $criteria ) : mixed Register Criteria function
selectCollection ( string $name ) : object Select collection
vacuum ( ) Vacuum database

Method Details

__construct() public method

Constructor
public __construct ( string $path = ":memory:", array $options = [] )
$path string
$options array

__get() public method

public __get ( $collection )

callCriteriaFunction() public method

Execute registred criteria function
public callCriteriaFunction ( string $id, array $document ) : boolean
$id string
$document array
return boolean

createCollection() public method

Create a collection
public createCollection ( string $name )
$name string

drop() public method

Drop database
public drop ( )

dropCollection() public method

Drop a collection
public dropCollection ( string $name )
$name string

getCollectionNames() public method

Get all collection names in the database
public getCollectionNames ( ) : array
return array

listCollections() public method

Get all collections in the database
public listCollections ( ) : array
return array

registerCriteriaFunction() public method

Register Criteria function
public registerCriteriaFunction ( mixed $criteria ) : mixed
$criteria mixed
return mixed

selectCollection() public method

Select collection
public selectCollection ( string $name ) : object
$name string
return object

vacuum() public method

Vacuum database
public vacuum ( )

Property Details

$collections protected_oe property

protected array $collections
return array

$connection public_oe property

object
public $connection

$document_criterias protected_oe property

protected array $document_criterias
return array

$path protected_oe property

protected string $path
return string