Procházet zdrojové kódy

Fix magic access to properties in MongoDB class

Andreas Braun před 10 roky
rodič
revize
4dcca5e8c9
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  1. 11 1
      lib/Mongo/MongoDB.php

+ 11 - 1
lib/Mongo/MongoDB.php

@@ -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;