From 88131dd7ff492c6e412b39bb9a2ca79381a1c5c3 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 23 Nov 2012 15:29:46 +0100 Subject: [PATCH] ORM: pass some __METHOD__ to database functions Change-Id: Ic76f88fe682118a097964e4011678ef4ad69113b --- includes/db/ORMRow.php | 5 +++-- includes/db/ORMTable.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/db/ORMRow.php b/includes/db/ORMRow.php index d64530f34a..5c730fb314 100644 --- a/includes/db/ORMRow.php +++ b/includes/db/ORMRow.php @@ -120,7 +120,8 @@ abstract class ORMRow implements IORMRow { $result = $this->table->rawSelectRow( $this->table->getPrefixedFields( $fields ), array( $this->table->getPrefixedField( 'id' ) => $this->getId() ), - array( 'LIMIT' => 1 ) + array( 'LIMIT' => 1 ), + __METHOD__ ); if ( $result !== false ) { @@ -418,7 +419,7 @@ abstract class ORMRow implements IORMRow { public function remove() { $this->beforeRemove(); - $success = $this->table->delete( array( 'id' => $this->getId() ) ); + $success = $this->table->delete( array( 'id' => $this->getId() ), __METHOD__ ); // DatabaseBase::delete does not always return true for success as documented... $success = $success !== false; diff --git a/includes/db/ORMTable.php b/includes/db/ORMTable.php index e3c8aa7a20..1292963087 100644 --- a/includes/db/ORMTable.php +++ b/includes/db/ORMTable.php @@ -332,7 +332,8 @@ abstract class ORMTable extends DBAccessBase implements IORMTable { $res = $this->rawSelectRow( array( 'rowcount' => 'COUNT(*)' ), $this->getPrefixedValues( $conditions ), - $options + $options, + __METHOD__ ); return $res->rowcount; @@ -354,7 +355,7 @@ abstract class ORMTable extends DBAccessBase implements IORMTable { $result = $dbw->delete( $this->getName(), $conditions === array() ? '*' : $this->getPrefixedValues( $conditions ), - $functionName + is_null( $functionName ) ? __METHOD__ : $functionName ) !== false; // DatabaseBase::delete does not always return true for success as documented... $this->releaseConnection( $dbw ); -- 2.20.1