You are here

protected static function RestfulDataProviderEFQ::isValidConjunctionForFilter in RESTful 7

Overrides \RestfulBase::isValidConjuctionForFilter().

Overrides RestfulBase::isValidConjunctionForFilter

File

plugins/restful/RestfulDataProviderEFQ.php, line 268
Contains \RestfulDataProviderEFQ

Class

RestfulDataProviderEFQ
@file Contains \RestfulDataProviderEFQ

Code

protected static function isValidConjunctionForFilter($conjunction) {
  $allowed_conjunctions = array(
    'AND',
  );
  if (!in_array(strtoupper($conjunction), $allowed_conjunctions)) {
    throw new \RestfulBadRequestException(format_string('Conjunction "@conjunction" is not allowed for filtering on this resource. Allowed conjunctions are: !allowed', array(
      '@conjunction' => $conjunction,
      '!allowed' => implode(', ', $allowed_conjunctions),
    )));
  }
}