MongoLite\Collection::renameCollection PHP Méthode

renameCollection() public méthode

Rename Collection
public renameCollection ( string $newname ) : boolean
$newname string [description]
Résultat 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;
    }