protected function WebformOptionsListBuilder::getQuery in Webform 8.5
Same name and namespace in other branches
- 6.x src/WebformOptionsListBuilder.php \Drupal\webform\WebformOptionsListBuilder::getQuery()
Get the base entity query filtered by search and category.
Parameters
string $keys: (optional) Search key.
string $category: (optional) Category.
Return value
\Drupal\Core\Entity\Query\QueryInterface An entity query.
1 call to WebformOptionsListBuilder::getQuery()
- WebformOptionsListBuilder::getEntityIds in src/
WebformOptionsListBuilder.php - Loads entity IDs using a pager sorted by the entity id.
File
- src/
WebformOptionsListBuilder.php, line 256
Class
- WebformOptionsListBuilder
- Defines a class to build a listing of webform options entities.
Namespace
Drupal\webformCode
protected function getQuery($keys = '', $category = '') {
$query = $this
->getStorage()
->getQuery();
// Filter by key(word).
if ($keys) {
$or = $query
->orConditionGroup()
->condition('id', $keys, 'CONTAINS')
->condition('title', $keys, 'CONTAINS')
->condition('options', $keys, 'CONTAINS');
$query
->condition($or);
}
// Filter by category.
if ($category) {
$query
->condition('category', $category);
}
return $query;
}