Skip to content
Snippets Groups Projects
Commit fa69f7f2 authored by catch's avatar catch
Browse files

Issue #1922396 by damiankloip: Add groupable_only() parameter to...

Issue #1922396 by damiankloip: Add groupable_only() parameter to DisplayPluginBase::getFieldLabels().
parent bced82e4
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -894,20 +894,18 @@ public function getHandlers($type) {
}
/**
* Retrieve a list of fields for the current display with the
* relationship associated if it exists.
* Retrieves a list of fields for the current display.
*
* @param $groupable_only
* Return only an array of field labels from handler that return TRUE
* from use_string_group_by method.
* This also takes into account any associated relationships, if they exist.
*
* @param bool $groupable_only
* (optional) TRUE to only return an array of field labels from handlers
* that support the use_string_group_by method, defaults to FALSE.
*
* @return array
* An array of applicable field options, keyed by ID.
*/
public function getFieldLabels() {
// Use func_get_arg so the function signature isn't amended
// but we can still pass TRUE into the function to filter
// by groupable handlers.
$args = func_get_args();
$groupable_only = isset($args[0]) ? $args[0] : FALSE;
public function getFieldLabels($groupable_only = FALSE) {
$options = array();
foreach ($this->getHandlers('relationship') as $relationship => $handler) {
if ($label = $handler->label()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment