MongoLite\Collection::renameCollection PHP Метод

renameCollection() публичный Метод

Rename Collection
public renameCollection ( string $newname ) : boolean
$newname string [description]
Результат boolean
    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;
    }