Problem/Motivation

I've built a datasource that needs the options of a related processor to work correctly. Unfortunately it's not possible to access the defined processors from outside of an index.
Currently this is only possible by "hijacking" the method:

class SearchApiIndex Hijack extends SearchApiIndex {
  public static function getProtectedProcessors(SearchApiIndex $index) {
    return $index->getProcessors();
  }
}

Proposed resolution

Change visibility of SearchApiIndex::getProcessors() from protected to public.

Remaining tasks

Make a decision :)

User interface changes

none

API changes

SearchApiIndex::getProcessors() will become more visible. Shouldn't have any impact on existing code.

Comments

drunken monkey’s picture

Title: Change the visibility of SearchApiIndex::getProcessors() » Add clean way for retrieving an index's data alterations and processors
Status: Active » Needs review
StatusFileSize
new1.74 KB

Seems reasonable enough, I guess. You can of course also look at the index option and load the processor objects yourself, but I admit that just using the method is cleaner. Also, I really can't see a downside.

Please see the attached patch. I also made getAlterCallbacks() (where the exact same argument applies) public and did a bit of comment-tidying in that vicinity.

das-peter’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I'd say RTBC.

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great, committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.