moadminModel::__construct PHP Method

__construct() public method

Connects to a Mongo database if the name of one is supplied as an argument
public __construct ( string $db = null )
$db string
    public function __construct($db = null)
    {
        if ($db) {
            if (!extension_loaded('mongo')) {
                throw new mongoExtensionNotInstalled();
            }
            try {
                $this->_db = $this->_mongo();
                $this->mongo = $this->_db->selectDB($db);
            } catch (MongoConnectionException $e) {
                throw new cannotConnectToMongoServer();
            }
        }
    }