Merge "Allow SearchEngine users to access features data"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 27 Jan 2017 16:59:08 +0000 (16:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 27 Jan 2017 16:59:08 +0000 (16:59 +0000)
includes/search/SearchEngine.php

index 0bcb07a..206067f 100644 (file)
@@ -109,6 +109,20 @@ abstract class SearchEngine {
                $this->features[$feature] = $data;
        }
 
+       /**
+        * Way to retrieve custom data set by setFeatureData
+        * or by the engine itself.
+        * @since 1.29
+        * @param string $feature feature name
+        * @return mixed the feature value or null if unset
+        */
+       public function getFeatureData( $feature ) {
+               if ( isset ( $this->features[$feature] ) ) {
+                       return $this->features[$feature];
+               }
+               return null;
+       }
+
        /**
         * When overridden in derived class, performs database-specific conversions
         * on text to be used for searching or updating search index.