src/Utility/Export.php
protected function getHeaders(): array
    {
        $displayColumns = $this->getDisplayColumns();

        if (empty($displayColumns)) {
            return [];
        }

        $table = TableRegistry::get($this->search->get('model'));

        $associationLabels = Utility::instance()->getAssociationLabels($table);
        $searchableFields = Utility::instance()->getSearchableFields($table, $this->user);

        $result = [];
        foreach ($displayColumns as $column) {
            $label = $column;
            if (array_key_exists($label, $searchableFields)) {
                $label = $searchableFields[$label]['label'];
            }

            list($fieldModel, ) = pluginSplit($column);
            if (array_key_exists($fieldModel, $associationLabels)) {
                $label .= ' (' . $associationLabels[$fieldModel] . ')';
            }

            $result[] = $label;
        }

        return $result;
    }
protected function getHeaders(): array
    {
        $displayColumns = $this->getDisplayColumns();

        if (empty($displayColumns)) {
            return [];
        }

        $table = TableRegistry::get($this->search->get('model'));

        $associationLabels = Utility::instance()->getAssociationLabels($table);
        $searchableFields = Utility::instance()->getSearchableFields($table, $this->user);

        $result = [];
        foreach ($displayColumns as $column) {
            $label = $column;
            if (array_key_exists($label, $searchableFields)) {
                $label = $searchableFields[$label]['label'];
            }

            list($fieldModel, ) = pluginSplit($column);
            if (array_key_exists($fieldModel, $associationLabels)) {
                $label .= ' (' . $associationLabels[$fieldModel] . ')';
            }

            $result[] = $label;
        }

        return $result;
    }
protected function getHeaders ( ) : array { $ displayColumns = $ this -> getDisplayColumns ( ) ; if ( empty ( $ displayColumns ) ) { return [ ] ; } $ table = TableRegistry :: get ( $ this -> search -> get ( 'model' ) ) ; $ associationLabels = Utility :: instance ( ) -> getAssociationLabels ( $ table ) ; $ searchableFields = Utility :: instance ( ) -> getSearchableFields ( $ table , $ this -> user ) ; $ result = [ ] ; foreach ( $ displayColumns as $ column ) { $ label = $ column ; if ( array_key_exists ( $ label , $ searchableFields ) ) { $ label = $ searchableFields [ $ label ] [ 'label' ] ; } list ( $ fieldModel , ) = pluginSplit ( $ column ) ; if ( array_key_exists ( $ fieldModel , $ associationLabels ) ) { $ label .= ' (' . $ associationLabels [ $ fieldModel ] . ')' ; } $ result [ ] = $ label ; } return $ result ; }
Get export headers.

@return mixed[]
Get export headers .