XDB::execute('INSERT INTO requests (user_id, type, data, stamp) VALUES ({?}, {?}, {?}, {?})',
$this->uid, $this->type, $this, $this->stamp);
+ global $globals;
+ update_NbValid();
return true;
}
public function clean()
{
if ($this->unique) {
- return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
- $this->uid, $this->type);
+ $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
+ $this->uid, $this->type);
} else {
- return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
- $this->uid, $this->type, $this->stamp);
+ $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
+ $this->uid, $this->type, $this->stamp);
}
+ update_NbValid();
+ return $success;
}
// }}}