* @return bool
*/
public function removeWatch() {
+ wfProfileIn( __METHOD__ );
+
$success = false;
$dbw = wfGetDB( DB_MASTER );
$dbw->delete( 'watchlist',
if ( $dbw->affectedRows() ) {
$success = true;
}
+
+ wfProfileOut( __METHOD__ );
return $success;
}
/**
* Handle duplicate entries. Backend for duplicateEntries().
+ *
+ * @param $ot Title
+ * @param $nt Title
+ *
+ * @return bool
*/
private static function doDuplicateEntries( $ot, $nt ) {
$oldnamespace = $ot->getNamespace();
);
# Construct array to replace into the watchlist
$values = array();
- while ( $s = $dbw->fetchObject( $res ) ) {
+ foreach ( $res as $s ) {
$values[] = array(
'wl_user' => $s->wl_user,
'wl_namespace' => $newnamespace,