예제 #1
0
 /**
  * Wrapper method for MongoClient::dropDB().
  *
  * This method will dispatch preDropDatabase and postDropDatabase events.
  *
  * @see http://php.net/manual/en/mongoclient.dropdb.php
  * @param string $database
  * @return array
  */
 public function dropDatabase($database)
 {
     if ($this->eventManager->hasListeners(Events::preDropDatabase)) {
         $this->eventManager->dispatchEvent(Events::preDropDatabase, new EventArgs($this, $database));
     }
     $this->initialize();
     $result = $this->mongoClient->dropDB($database);
     if ($this->eventManager->hasListeners(Events::postDropDatabase)) {
         $this->eventManager->dispatchEvent(Events::postDropDatabase, new EventArgs($this, $result));
     }
     return $result;
 }