*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
$queues = EntityQueue::loadMultipleByTargetType($this->getEntityType());
- $options = array();
+ $options = [];
foreach ($queues as $queue) {
$options[$queue->id()] = $queue->label();
}
- $form['limit_queue'] = array(
+ $form['limit_queue'] = [
'#type' => 'radios',
'#title' => $this->t('Limit to a specific entity queue'),
'#options' => $options,
'#default_value' => $this->options['limit_queue'],
- );
+ ];
parent::buildOptionsForm($form, $form_state);
}
* {@inheritdoc}
*/
public function query() {
- parent::query();
-
// Add a 'where' condition if needed.
if (!empty($this->definition['extra'])) {
$bundles = [];
$bundles[] = $extra['value'];
}
}
- $this->definition['join_extra'][] = [
- 'field' => 'bundle',
- 'operator' => 'IN',
- 'value' => [$bundles],
- ];
+ if (count($bundles) > 0) {
+ $this->definition['join_extra'][] = [
+ 'field' => 'bundle',
+ 'value' => $bundles,
+ ];
+ }
}
+
+ // Now - let's build the query.
+ parent::query();
}
}