|
@@ -30,11 +30,21 @@ class MongoDB
|
|
|
const PROFILING_ON = 2;
|
|
const PROFILING_ON = 2;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * @var MongoClient
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $connection;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* @var \MongoDB\Database
|
|
* @var \MongoDB\Database
|
|
|
*/
|
|
*/
|
|
|
protected $db;
|
|
protected $db;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
|
+ * @var string
|
|
|
|
|
+ */
|
|
|
|
|
+ protected $name;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* Creates a new database
|
|
* Creates a new database
|
|
|
*
|
|
*
|
|
|
* This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}.
|
|
* This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}.
|
|
@@ -44,7 +54,7 @@ class MongoDB
|
|
|
* @throws Exception
|
|
* @throws Exception
|
|
|
* @return MongoDB Returns the database.
|
|
* @return MongoDB Returns the database.
|
|
|
*/
|
|
*/
|
|
|
- public function __construct($conn, $name)
|
|
|
|
|
|
|
+ public function __construct(MongoClient $conn, $name)
|
|
|
{
|
|
{
|
|
|
$this->connection = $conn;
|
|
$this->connection = $conn;
|
|
|
$this->name = $name;
|
|
$this->name = $name;
|