summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-05 08:26:35 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-08-05 08:26:35 +0000
commit755343e3b796bb875ea4df4e428e8f513c7fca6f (patch)
treedb09897142936a578a3992e0f7d381a1c75d9942
parente574bcffcebf168a8b2f329b2eea8269f494be6c (diff)
downloadbrdo-755343e3b796bb875ea4df4e428e8f513c7fca6f.tar.gz
brdo-755343e3b796bb875ea4df4e428e8f513c7fca6f.tar.bz2
#807336 by jhodgdon, Berdir, Crell: Document thrown exceptions in database layer.
-rw-r--r--includes/database/database.inc14
-rw-r--r--includes/database/query.inc7
2 files changed, 21 insertions, 0 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index 600b5c994..9e913de90 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -537,6 +537,8 @@ abstract class DatabaseConnection extends PDO {
* query builder and should not be set by a user. If there is an error,
* this method will return NULL and may throw an exception if
* $options['throw_exception'] is TRUE.
+ *
+ * @throws PDOException
*/
public function query($query, array $args = array(), $options = array()) {
@@ -875,6 +877,8 @@ abstract class DatabaseConnection extends PDO {
* The name of the savepoint. The default, 'drupal_transaction', will roll
* the entire transaction back.
*
+ * @throws DatabaseTransactionNoActiveException
+ *
* @see DatabaseTransaction::rollback()
*/
public function rollback($savepoint_name = 'drupal_transaction') {
@@ -912,6 +916,8 @@ abstract class DatabaseConnection extends PDO {
*
* If no transaction is already active, we begin a new transaction.
*
+ * @throws DatabaseTransactionNameNonUniqueException
+ *
* @see DatabaseTransaction
*/
public function pushTransaction($name) {
@@ -942,6 +948,9 @@ abstract class DatabaseConnection extends PDO {
* @param $name
* The name of the savepoint
*
+ * @throws DatabaseTransactionNoActiveException
+ * @throws DatabaseTransactionCommitFailedException
+ *
* @see DatabaseTransaction
*/
public function popTransaction($name) {
@@ -1094,6 +1103,8 @@ abstract class DatabaseConnection extends PDO {
* A direct commit bypasses all of the safety checks we've built on top of
* PDO's transaction routines.
*
+ * @throws DatabaseTransactionExplicitCommitNotAllowedException
+ *
* @see DatabaseTransaction
*/
public function commit() {
@@ -1468,6 +1479,9 @@ abstract class Database {
* "default".
* @param $target
* The database target to open.
+ *
+ * @throws DatabaseConnectionNotDefinedException
+ * @throws DatabaseDriverNotSpecifiedException
*/
final protected static function openConnection($key, $target) {
if (empty(self::$databaseInfo)) {
diff --git a/includes/database/query.inc b/includes/database/query.inc
index 75f292cfe..5a359f7e0 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -535,6 +535,9 @@ class InsertQuery extends Query {
*
* @return
* TRUE if the validation was successful, FALSE if not.
+ *
+ * @throws FieldsOverlapException
+ * @throws NoFieldsException
*/
public function preExecute() {
// Confirm that the user did not try to specify an identical
@@ -782,6 +785,8 @@ class MergeQuery extends Query {
*
* @return
* TRUE if the validation was successful, FALSE if not.
+ *
+ * @throws InvalidMergeQueryException
*/
public function preExecute() {
@@ -800,6 +805,8 @@ class MergeQuery extends Query {
* A status indicating the executed operation:
* - MergeQuery::STATUS_INSERT for an INSERT operation.
* - MergeQuery::STATUS_UPDATE for an UPDATE operation.
+ *
+ * @throws InvalidMergeQueryException
*/
public function execute() {
// If validation fails, simply return NULL.