public function renameCollection($newname)
{
if (!in_array($newname, $this->database->getCollectionNames())) {
$this->database->connection->exec("ALTER TABLE '.{$this->name}.' RENAME TO {$newname}");
$this->name = $newname;
return true;
}
return false;
}