$form['subquery_namespace'] = [ '#type' => 'textfield', '#title' => $this->t('Subquery namespace'), '#description' => $this->t('Advanced. Enter a namespace for the subquery used by this relationship.'), '#default_value' => $this->options['subquery_namespace'], ];
// WIP: This stuff doesn't work yet: namespacing issues.
// A list of suitable views to pick one as the subview.
$views = ['' => '- None -']; foreach(Views::getAllViews()as$view){ // Only get views that are suitable:
// - base must the base that our relationship joins towards
// - must have fields.
if($view->get('base_table') == $this->definition['base'] && !empty($view->getDisplay('default')['display_options']['fields'])){ // TODO: check the field is the correct sort?
// or let users hang themselves at this stage and check later?
$views[$view->id()] = $view->id(); } }
// We can store this now, as we have enabled/disabled above.
$all_views = $storage->loadMultiple();
// Test Views::getAllViews().
ksort($all_views); $this->assertEquals(array_keys($all_views), array_keys(Views::getAllViews()), 'Views::getAllViews works as expected.');