adapted WikiPage and Article (work in progress)
[lhc/web/wiklou.git] / includes / ContentHandler.php
index b7761d6..025c740 100644 (file)
  */
 abstract class ContentHandler {
 
+    public static function getContentText( Content $content ) {
+        if ( !$content ) return '';
+
+        if ( $content instanceof TextContent ) {
+            #XXX: or check by model name?
+            #XXX: or define $content->allowRawData()?
+            return $content->getRawData();
+        }
+
+        return null;
+    }
+
     public static function getDefaultModelFor( Title $title ) {
         global $wgNamespaceContentModels;