PHP Class moadminModel, nodejs-autorestart

Afficher le fichier Open project: shimondoodkin/nodejs-autorestart Class Usage Examples

Méthodes publiques

Свойство Type Description
$colKeys array Array keys in the first and last object in a collection merged together (used to build sort-by options)
$count integer Number of rows in the entire resultset (before limit-clause is applied)
$mongo MongoDB MongoDB
$sort array Sort array - currently only used for collections
$totalDbSize integer Total size of all the databases

Protected Properties

Свойство Type Description
$_db Mongo mongo connection - if a MongoDB object already exists (from a previous script) then only DB operations use this

Méthodes publiques

Méthode Description
__construct ( string $db = null ) Connects to a Mongo database if the name of one is supplied as an argument
createCollection ( string $collection ) Creates a collection
deleteIndex ( string $collection, array $index ) Removes an index
dropCollection ( string $collection ) Drops a collection
dropDb ( ) Drops a database
editObject ( string $collection, string $_id, string $idtype ) : array Retieves an object for editing
ensureIndex ( string $collection, array $indexes, array $unique ) Ensures an index
getStats ( ) : array Generate system info and stats
listCollections ( ) : array Gets a list of database collections
listDbs ( ) : array Gets list of databases
listIndexes ( string $collection ) : array Gets a list of the indexes on a collection
listRows ( string $collection ) : array Get the records in a collection
removeObject ( string $collection, string $_id, string $idtype ) Removes an object from a collection
repairDb ( ) : array Repairs a database
saveObject ( string $collection, string $obj ) : array Saves an object
setDb ( string $db ) Change the DB connection

Méthodes protégées

Méthode Description
_exec ( string $cmd ) : mixed Executes a native JS MongoDB command This method is not currently used for anything
_mongo ( ) : Mongo Returns a new Mongo connection
_unserialize ( string $_id, string $idtype ) : mixed Returns a serialized element back to its native PHP form

Method Details

__construct() public méthode

Connects to a Mongo database if the name of one is supplied as an argument
public __construct ( string $db = null )
$db string

_exec() protected méthode

Executes a native JS MongoDB command This method is not currently used for anything
protected _exec ( string $cmd ) : mixed
$cmd string
Résultat mixed

_mongo() protected méthode

Returns a new Mongo connection
protected _mongo ( ) : Mongo
Résultat Mongo

_unserialize() protected méthode

Returns a serialized element back to its native PHP form
protected _unserialize ( string $_id, string $idtype ) : mixed
$_id string
$idtype string
Résultat mixed

createCollection() public méthode

Creates a collection
public createCollection ( string $collection )
$collection string

deleteIndex() public méthode

Removes an index
public deleteIndex ( string $collection, array $index )
$collection string
$index array Must match the array signature of the index

dropCollection() public méthode

Drops a collection
public dropCollection ( string $collection )
$collection string

dropDb() public méthode

Drops a database
public dropDb ( )

editObject() public méthode

Retieves an object for editing
public editObject ( string $collection, string $_id, string $idtype ) : array
$collection string
$_id string
$idtype string
Résultat array

ensureIndex() public méthode

Ensures an index
public ensureIndex ( string $collection, array $indexes, array $unique )
$collection string
$indexes array
$unique array

getStats() public méthode

Generate system info and stats
public getStats ( ) : array
Résultat array

listCollections() public méthode

Gets a list of database collections
public listCollections ( ) : array
Résultat array

listDbs() public méthode

Gets list of databases
public listDbs ( ) : array
Résultat array

listIndexes() public méthode

Gets a list of the indexes on a collection
public listIndexes ( string $collection ) : array
$collection string
Résultat array

listRows() public méthode

Get the records in a collection
public listRows ( string $collection ) : array
$collection string
Résultat array

removeObject() public méthode

Removes an object from a collection
public removeObject ( string $collection, string $_id, string $idtype )
$collection string
$_id string
$idtype string

repairDb() public méthode

Repairs a database
public repairDb ( ) : array
Résultat array Success status

saveObject() public méthode

Saves an object
public saveObject ( string $collection, string $obj ) : array
$collection string
$obj string
Résultat array

setDb() public méthode

Change the DB connection
public setDb ( string $db )
$db string

Property Details

$_db protected_oe property

mongo connection - if a MongoDB object already exists (from a previous script) then only DB operations use this
protected Mongo $_db
Résultat Mongo

$colKeys public_oe property

Array keys in the first and last object in a collection merged together (used to build sort-by options)
public array $colKeys
Résultat array

$count public_oe property

Number of rows in the entire resultset (before limit-clause is applied)
public int $count
Résultat integer

$mongo public_oe property

MongoDB
public MongoDB $mongo
Résultat MongoDB

$sort public_oe property

Sort array - currently only used for collections
public array $sort
Résultat array

$totalDbSize public_oe property

Total size of all the databases
public int $totalDbSize
Résultat integer