public function deleteWorkspace($name)
{
if (!$this->workspaceExists($name)) {
throw new RepositoryException("Workspace '{$name}' cannot be\n deleted as it does not exist");
}
try {
$this->getConnection()->delete('phpcr_workspaces', array('name' => $name));
} catch (\Exception $e) {
throw new RepositoryException("Couldn't delete workspace '{$name}': " . $e->getMessage(), 0, $e);
}
try {
$this->getConnection()->delete('phpcr_nodes', array('workspace_name' => $name));
} catch (\Exception $e) {
throw new RepositoryException("Couldn't delete nodes in workspace\n '{$name}': " . $e->getMessage(), 0, $e);
}
try {
$this->getConnection()->delete('phpcr_binarydata', array('workspace_name' => $name));
} catch (\Exception $e) {
throw new RepositoryException("Couldn't delete binary data in\n workspace '{$name}': " . $e->getMessage(), 0, $e);
}
}