AugmentPageProps.php 469 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Augment search result set with values of certain page props.
  4. */
  5. class AugmentPageProps implements ResultSetAugmentor {
  6. /**
  7. * @var array List of properties.
  8. */
  9. private $propnames;
  10. public function __construct( $propnames ) {
  11. $this->propnames = $propnames;
  12. }
  13. public function augmentAll( ISearchResultSet $resultSet ) {
  14. $titles = $resultSet->extractTitles();
  15. return PageProps::getInstance()->getProperties( $titles, $this->propnames );
  16. }
  17. }