class VisibleLocalesColumn implements GridField_ColumnProvider (View source)

Adds a "visible in locales" column to a gridfield

Traits

Methods

protected
DBField|null
addFluentBadge(DBField|null $badgeField, DataObject $record)

Add the Fluent state badge before any existing badges and return the result

public
DBField|null
getBadge(DataObject $record)

Given a record with Fluent enabled, return a badge that represents the state of it in the current locale

protected
string
generateBadgeHTML(DataObject $record, Locale $locale, array $extraProperties = [])

No description

public
augmentColumns(GridField $gridField, array $columns)

Modify the list of columns displayed in the table.

public
array
getColumnsHandled(GridField $gridField)

Names of all columns which are affected by this component.

public
string
getColumnContent(GridField $gridField, ViewableData $record, string $columnName)

HTML for the column, content of the element.

public
array
getColumnAttributes(GridField $gridField, ViewableData $record, string $columnName)

Attributes for the element containing the content returned by getColumnContent().

public
array
getColumnMetadata(GridField $gridField, string $columnName)

Additional metadata about the column which can be used by other components, e.g. to set a title for a search column header.

Details

protected DBField|null addFluentBadge(DBField|null $badgeField, DataObject $record)

Add the Fluent state badge before any existing badges and return the result

Parameters

DBField|null $badgeField

Existing badge to merge with

DataObject $record

Return Value

DBField|null

DBField|null getBadge(DataObject $record)

Given a record with Fluent enabled, return a badge that represents the state of it in the current locale

Parameters

DataObject $record

Return Value

DBField|null

protected string generateBadgeHTML(DataObject $record, Locale $locale, array $extraProperties = [])

No description

Parameters

DataObject $record
Locale $locale
array $extraProperties

Return Value

string

augmentColumns(GridField $gridField, array $columns)

Modify the list of columns displayed in the table.

Parameters

GridField $gridField
array $columns

List reference of all column names.

See also

{@link GridFieldDataColumns->getDisplayFields()}
{@link GridFieldDataColumns}.

array getColumnsHandled(GridField $gridField)

Names of all columns which are affected by this component.

Parameters

GridField $gridField

Return Value

array

string getColumnContent(GridField $gridField, ViewableData $record, string $columnName)

HTML for the column, content of the element.

Parameters

GridField $gridField
ViewableData $record
  • Record displayed in this row
string $columnName

Return Value

string
  • HTML for the column. Return NULL to skip.

array getColumnAttributes(GridField $gridField, ViewableData $record, string $columnName)

Attributes for the element containing the content returned by getColumnContent().

Parameters

GridField $gridField
ViewableData $record

displayed in this row

string $columnName

Return Value

array

array getColumnMetadata(GridField $gridField, string $columnName)

Additional metadata about the column which can be used by other components, e.g. to set a title for a search column header.

Parameters

GridField $gridField
string $columnName

Return Value

array
  • Map of arbitrary metadata identifiers to their values.