public function renameView($oldName, $newName)
    {
        if (!$this->hasView($oldName)) {
            throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName);
        }

        if ($this->hasView($newName)) {
            throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName);
        }

        $this->views[$oldName]->setName($newName);
        $this->views[$newName] = $this->views[$oldName];

        unset($this->views[$oldName]);
    }