*/
abstract public function serializeContent( Content $content, $format = null );
+ /**
+ * Applies transformations on export (returns the blob unchanged per default).
+ * Subclasses may override this to perform transformations such as conversion
+ * of legacy formats or filtering of internal meta-data.
+ *
+ * @param string $blob The blob to be exported
+ * @param string|null $format The blob's serialization format
+ *
+ * @return string
+ */
+ public function exportTransform( $blob, $format = null ) {
+ return $blob;
+ }
+
/**
* Unserializes a Content object of the type supported by this ContentHandler.
*
*/
abstract public function unserializeContent( $blob, $format = null );
+ /**
+ * Apply import transformation (per default, returns $blob unchanged).
+ * This gives subclasses an opportunity to transform data blobs on import.
+ *
+ * @since 1.24
+ *
+ * @param string $blob
+ * @param string|null $format
+ *
+ * @return string
+ */
+ public function importTransform( $blob, $format = null ) {
+ return $blob;
+ }
+
/**
* Creates an empty Content object of the type supported by this
* ContentHandler.
/**
* Creates a new Content object that acts as a redirect to the given page,
- * or null of redirects are not supported by this content model.
+ * or null if redirects are not supported by this content model.
*
* This default implementation always returns null. Subclasses supporting redirects
* must override this method.