Add isNewPage() method
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 21 Dec 2008 09:33:04 +0000 (09:33 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 21 Dec 2008 09:33:04 +0000 (09:33 +0000)
includes/Title.php

index a49b725..4f82e95 100644 (file)
@@ -3026,6 +3026,16 @@ class Title {
                        array( 'ORDER BY' => 'rev_id' )
                );
        }
+       
+       /**
+        * Check if this is a new page
+        *
+        * @return bool
+        */
+       public function isNewPage() {
+               $dbr = wfGetDB( DB_SLAVE );
+               return (bool)$dbr->selectField( 'page', 'page_is_new', $this->pageCond(), __METHOD__ );
+       }
 
        /**
         * Get the oldest revision timestamp of this page