protected function workspaceExists($workspaceName)
{
try {
$query = 'SELECT 1 FROM phpcr_workspaces WHERE name = ?';
$result = $this->getConnection()->fetchColumn($query, array($workspaceName));
} catch (\Exception $e) {
if ($e instanceof DBALException || $e instanceof \PDOException) {
if (1045 == $e->getCode()) {
throw new LoginException('Access denied with your credentials: ' . $e->getMessage());
}
if ('42S02' == $e->getCode()) {
throw new RepositoryException('You did not properly set up the database for the repository. See README.md for more information. Message from backend: ' . $e->getMessage());
}
throw new RepositoryException('Unexpected error talking to the backend: ' . $e->getMessage(), 0, $e);
}
throw $e;
}
return $result;
}