protected static function DataProviderEntity::isValidOperatorsForFilter in RESTful 7.2
Overrides DataProvider::isValidOperatorsForFilter().
Overrides DataProvider::isValidOperatorsForFilter
File
- src/
Plugin/ resource/ DataProvider/ DataProviderEntity.php, line 828 - Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.
Class
- DataProviderEntity
- Class DataProviderEntity.
Namespace
Drupal\restful\Plugin\resource\DataProviderCode
protected static function isValidOperatorsForFilter(array $operators) {
$allowed_operators = array(
'=',
'>',
'<',
'>=',
'<=',
'<>',
'!=',
'BETWEEN',
'CONTAINS',
'IN',
'LIKE',
'NOT IN',
'STARTS_WITH',
);
foreach ($operators as $operator) {
if (!in_array($operator, $allowed_operators)) {
throw new BadRequestException(sprintf('Operator "%s" is not allowed for filtering on this resource. Allowed operators are: %s', $operator, implode(', ', $allowed_operators)));
}
}
}