src/ORM/Search/SearchContext.php
public function getSummary()
    {
        $list = ArrayList::create();
        foreach ($this->searchParams as $searchField => $searchValue) {
            if (empty($searchValue)) {
                continue;
            }
            $filter = $this->getFilter($searchField);
            if (!$filter) {
                continue;
            }

            $field = $this->fields->fieldByName($filter->getFullName());
            if (!$field) {
                continue;
            }

            // For dropdowns, checkboxes, etc, get the value that was presented to the user
            // e.g. not an ID
            if ($field instanceof SelectField) {
                $source = $field->getSource();
                if (isset($source[$searchValue])) {
                    $searchValue = $source[$searchValue];
                }
            } else {
                // For checkboxes, it suffices to simply include the field in the list, since it's binary
                if ($field instanceof CheckboxField) {
                    $searchValue = null;
                }
            }

            $list->push(ArrayData::create([
                'Field' => $field->Title(),
                'Value' => $searchValue,
            ]));
        }

        return $list;
    }
public function getSummary()
    {
        $list = ArrayList::create();
        foreach ($this->searchParams as $searchField => $searchValue) {
            if (empty($searchValue)) {
                continue;
            }
            $filter = $this->getFilter($searchField);
            if (!$filter) {
                continue;
            }

            $field = $this->fields->fieldByName($filter->getFullName());
            if (!$field) {
                continue;
            }

            // For dropdowns, checkboxes, etc, get the value that was presented to the user
            // e.g. not an ID
            if ($field instanceof SelectField) {
                $source = $field->getSource();
                if (isset($source[$searchValue])) {
                    $searchValue = $source[$searchValue];
                }
            } else {
                // For checkboxes, it suffices to simply include the field in the list, since it's binary
                if ($field instanceof CheckboxField) {
                    $searchValue = null;
                }
            }

            $list->push(ArrayData::create([
                'Field' => $field->Title(),
                'Value' => $searchValue,
            ]));
        }

        return $list;
    }
public function getSummary ( ) { $ list = ArrayList :: create ( ) ; foreach ( $ this -> searchParams as $ searchField => $ searchValue ) { if ( empty ( $ searchValue ) ) { continue ; } $ filter = $ this -> getFilter ( $ searchField ) ; if ( ! $ filter ) { continue ; } $ field = $ this -> fields -> fieldByName ( $ filter -> getFullName ( ) ) ; if ( ! $ field ) { continue ; } // For dropdowns, checkboxes, etc, get the value that was presented to the user // e.g. not an ID if ( $ field instanceof SelectField ) { $ source = $ field -> getSource ( ) ; if ( isset ( $ source [ $ searchValue ] ) ) { $ searchValue = $ source [ $ searchValue ] ; } } else { // For checkboxes, it suffices to simply include the field in the list, since it's binary if ( $ field instanceof CheckboxField ) { $ searchValue = null ; } } $ list -> push ( ArrayData :: create ( [ 'Field' => $ field -> Title ( ) , 'Value' => $ searchValue , ] ) ) ; } return $ list ; }
Gets a list of what fields were searched and the values provided
for each field. Returns an ArrayList of ArrayData, suitable for
rendering on a template.

@return ArrayList
Gets a list of what fields were searched and the values provided for each field . Returns an ArrayList of ArrayData suitable for rendering on a template .