class VersionedGridFieldState implements GridField_ColumnProvider (View source)

Properties

protected string $column
protected $versionedLabelFields

Fields/columns to display version states. We can specifies more than one field but states only show in the first column found.

Methods

public
__construct($versionedLabelFields = ['Name', 'Title'])

No description

public
string
getColumn()

Column to decorate with version state

public
setColumn(string $column)

No description

public
array
getVersionedLabelFields()

Search list for default column

public
setVersionedLabelFields(array $versionedLabelFields)

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, DataObject $record, string $columnName)

HTML for the column, content of the element.

public
array
getColumnAttributes(GridField $gridField, DataObject $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.

protected
array
getStatusFlags(Versioned|DataObject $record)

A flag provides the user with additional data about the current item status, for example a "removed from draft" status. Each item can have more than one status flag. Returns a map of a unique key to a (localized) title for the flag. The unique key can be reused as a CSS class.

Details

__construct($versionedLabelFields = ['Name', 'Title'])

No description

Parameters

$versionedLabelFields

string getColumn()

Column to decorate with version state

Return Value

string

VersionedGridFieldState setColumn(string $column)

No description

Parameters

string $column

Return Value

VersionedGridFieldState

array getVersionedLabelFields()

Search list for default column

Return Value

array

VersionedGridFieldState setVersionedLabelFields(array $versionedLabelFields)

No description

Parameters

array $versionedLabelFields

Return Value

VersionedGridFieldState

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, DataObject $record, string $columnName)

HTML for the column, content of the element.

Parameters

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

Return Value

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

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

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

Parameters

GridField $gridField
DataObject $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.

protected array getStatusFlags(Versioned|DataObject $record)

A flag provides the user with additional data about the current item status, for example a "removed from draft" status. Each item can have more than one status flag. Returns a map of a unique key to a (localized) title for the flag. The unique key can be reused as a CSS class.

Example (simple):

  "deletedonlive" => "Deleted"

Example (with optional title attribute):

  "deletedonlive" => array(
     'text' => "Deleted",
     'title' => 'This page has been deleted'
  )

Parameters

Versioned|DataObject $record
  • the record to check status for

Return Value

array