You are here

protected static function DataProviderEntity::isValidConjunctionForFilter in RESTful 7.2

Overrides DataProvider::isValidConjunctionForFilter().

Overrides DataProvider::isValidConjunctionForFilter

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 855
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

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