$def['table'
] =
$this->definition
['base'
];
$def['field'
] =
$base_field;
$def['left_table'
] =
$this->tableAlias;
$def['left_field'
] =
$this->field;
$def['adjusted'
] = TRUE;
if (!
empty($this->options
['required'
])) { $def['type'
] = 'INNER';
} if ($this->options
['subquery_regenerate'
]) { // For testing only, regenerate the subquery each time.
$def['left_query'
] =
$this->
leftQuery($this->options
);
} else { // Get the stored subquery SQL string.
$cid = 'views_relationship_groupwise_max:' .
$this->view->storage->
id() . ':' .
$this->view->current_display . ':' .
$this->options
['id'
];
$cache = \Drupal::
cache('data'
)->
get($cid);
if (isset($cache->data
)) { $def['left_query'
] =
$cache->data;
} else { $def['left_query'
] =
$this->
leftQuery($this->options
);
\Drupal::
cache('data'
)->
set($cid,
$def['left_query'
]);
}