class ReorderFields (View source)

Reorder the field labels based on the user-selected fields to display.

Methods

array
reorder(string|array $fields, array $fieldLabels, array $data)

Given a simple list of user-supplied field keys or field labels, return a reordered version of the field labels matching the user selection.

reorderFieldLabels($fields, $fieldLabels, $data)

No description

getSelectedFieldKeys($fields, $fieldLabels)

No description

matchFieldInLabelMap($field, $fieldLabels)

No description

convertToRegex($str)

Convert the provided string into a regex suitable for use in preg_match.

bool
isRegex(string $str)

Checks whether the string is a regex. This function is copied from MultiplePcreFilterIterator in the Symfony Finder component.

Details

array reorder(string|array $fields, array $fieldLabels, array $data)

Given a simple list of user-supplied field keys or field labels, return a reordered version of the field labels matching the user selection.

Parameters

string|array $fields

The user-selected fields

array $fieldLabels

An associative array mapping the field key to the field label

array $data

The data that will be rendered.

Return Value

array

protected reorderFieldLabels($fields, $fieldLabels, $data)

No description

Parameters

$fields
$fieldLabels
$data

protected getSelectedFieldKeys($fields, $fieldLabels)

No description

Parameters

$fields
$fieldLabels

protected matchFieldInLabelMap($field, $fieldLabels)

No description

Parameters

$field
$fieldLabels

protected convertToRegex($str)

Convert the provided string into a regex suitable for use in preg_match.

Matching occurs in the same way as the Symfony Finder component: http://symfony.com/doc/current/components/finder.html#file-name

Parameters

$str

protected bool isRegex(string $str)

Checks whether the string is a regex. This function is copied from MultiplePcreFilterIterator in the Symfony Finder component.

Parameters

string $str

Return Value

bool

Whether the given string is a regex