summaryrefslogtreecommitdiff
path: root/www/wiki/includes/search/AugmentPageProps.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/includes/search/AugmentPageProps.php')
-rw-r--r--www/wiki/includes/search/AugmentPageProps.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/www/wiki/includes/search/AugmentPageProps.php b/www/wiki/includes/search/AugmentPageProps.php
new file mode 100644
index 00000000..29bd463d
--- /dev/null
+++ b/www/wiki/includes/search/AugmentPageProps.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Augment search result set with values of certain page props.
+ */
+class AugmentPageProps implements ResultSetAugmentor {
+ /**
+ * @var array List of properties.
+ */
+ private $propnames;
+
+ public function __construct( $propnames ) {
+ $this->propnames = $propnames;
+ }
+
+ public function augmentAll( SearchResultSet $resultSet ) {
+ $titles = $resultSet->extractTitles();
+ return PageProps::getInstance()->getProperties( $titles, $this->propnames );
+ }
+}