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