make Message content available as Content object
authordaniel <daniel.kinzler@wikimedia.de>
Mon, 11 Jun 2012 12:10:12 +0000 (14:10 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Mon, 11 Jun 2012 12:10:12 +0000 (14:10 +0200)
includes/Message.php

index 3a87a00..b908981 100644 (file)
@@ -202,6 +202,11 @@ class Message {
         */
        protected $title = null;
 
+       /**
+        * Content object representing the message
+        */
+       protected $content = null;
+
        /**
         * @var string
         */
@@ -395,7 +400,15 @@ class Message {
                return $this;
        }
 
-       /**
+       public function content() {
+               if ( !$this->content ) {
+                       $this->content = new MessageContent( $this->key );
+               }
+
+               return $this->content;
+       }
+
+               /**
         * Returns the message parsed from wikitext to HTML.
         * @return String: HTML
         */