protected function getFieldsToDisplay(array $fields = null)
    {
        if (!empty($fields)) {
            return array_filter($this->fields, function ($field) use ($fields) {
                return in_array($field->name, $fields);
            });
        }

        return $this->fields;
    }
protected function getFieldsToDisplay(array $fields = null)
    {
        if (!empty($fields)) {
            return array_filter($this->fields, function ($field) use ($fields) {
                return in_array($field->name, $fields);
            });
        }

        return $this->fields;
    }
protected function getFieldsToDisplay ( array $ fields = null ) { if ( ! empty ( $ fields ) ) { return array_filter ( $ this -> fields , function ( $ field ) use ( $ fields ) { return in_array ( $ field -> name , $ fields ) ; } ) ; } return $ this -> fields ; }
It find the union field between a given collection and the current field collection.
If null is provided, the current field collection is returned.

@param array $fields

@return string
It find the union field between a given collection and the current field collection . If null is provided the current field collection is returned .