You are here

protected function PartyAlterStatusFilter::checkParty in Party 7

Run the appropriate checks on a party depending on the configuration.

Parameters

\Party $party: The party we are checking.

Return value

bool TRUE if this party passes the filter, FALSE if it doesn't.

1 call to PartyAlterStatusFilter::checkParty()
PartyAlterStatusFilter::alterItems in includes/search_api/callback_status_filter.inc
Alter items before indexing.

File

includes/search_api/callback_status_filter.inc, line 53
Status filter for search api.

Class

PartyAlterStatusFilter
Search API data alteration callback that filters out hidden parties.

Code

protected function checkParty(Party $party) {

  // Hidden always gets filtered out.
  if ($party->hidden) {
    return FALSE;
  }

  // If we've chosen to filter out archived, check it.
  if (!empty($this->options['archived']) && $party->archived) {
    return FALSE;
  }

  // If we've got this far, we've passed the filter.
  return TRUE;
}