+ * @param integer $type DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
+ */
+ public static function addUpdate( DeferrableUpdate $update, $type = self::POSTSEND ) {
+ if ( $type === self::PRESEND ) {
+ self::push( self::$preSendUpdates, $update );
+ } else {
+ self::push( self::$postSendUpdates, $update );
+ }
+ }
+
+ /**
+ * Add a callable update. In a lot of cases, we just need a callback/closure,
+ * defining a new DeferrableUpdate object is not necessary
+ *
+ * @see MWCallableUpdate::__construct()
+ *
+ * @param callable $callable
+ * @param integer $type DeferredUpdates constant (PRESEND or POSTSEND) (since 1.27)
+ */
+ public static function addCallableUpdate( $callable, $type = self::POSTSEND ) {
+ self::addUpdate( new MWCallableUpdate( $callable ), $type );
+ }
+
+ /**
+ * Do any deferred updates and clear the list
+ *
+ * @param string $mode Use "enqueue" to use the job queue when possible [Default: "run"]
+ * @param integer $type DeferredUpdates constant (PRESEND, POSTSEND, or ALL) (since 1.27)