class RowsOfFieldsWithMetadata extends RowsOfFields implements MetadataInterface, MetadataHolderInterface (View source)

A RowsOfFields data structure that also contains metadata.

Traits

A structured data object may contains some elements that are actually metadata. Metadata is not included in the output of tabular data formatters (e.g. table, csv), although some of these (e.g. table) may render the metadata alongside the data. Raw data formatters (e.g. yaml, json) will render both the data and the metadata.

Properties

protected $formatter from  FormatterAwareTrait
protected RenderCellInterface[] $rendererList from  RenderCellCollectionTrait
protected $dataKey from  MetadataHolderTrait
protected $metadataKey from  MetadataHolderTrait

Methods

__construct($data)

No description

array
getListData(FormatterOptions $options)

Convert data to a format suitable for use in a list.

getReorderedFieldLabels($data, $options, $defaults)

No description

getFields($options, $defaults)

No description

array
defaultOptions()

A structured list may provide its own set of default options. These will be used in place of the command's default options (from the annotations) in instances where the user does not provide the options explicitly (on the commandline) or implicitly (via a configuration file).

setFormatter(FormatterInterface $formatter)

No description

getFormatter()

No description

isHumanReadable()

No description

$this
addRenderer(RenderCellInterface $renderer, $priority = RenderCellCollectionInterface::PRIORITY_NORMAL)

Add a renderer

$this
addRendererFunction(callable $rendererFn, $priority = RenderCellCollectionInterface::PRIORITY_NORMAL)

Add a callable as a renderer

renderCell($key, $cellData, FormatterOptions $options, $rowData)

{@inheritdoc}

restructure(FormatterOptions $options)

Restructure this data for output by converting it into a table transformation object. First, though, remove any metadata items.

createTableTransformation($data, $options)

No description

instantiateTableTransformation($data, $fieldLabels, $rowLabels)

No description

convert(FormatterOptions $options)

No description

getDataKey()

No description

setDataKey($key)

No description

getMetadataKey()

No description

setMetadataKey($key)

No description

extractData($data)

No description

extractMetadata($data)

No description

reconstruct($data, $metadata)

No description

getMetadata()

Return the metadata associated with the structured data (if any)

Details

__construct($data)

No description

Parameters

$data

array getListData(FormatterOptions $options)

Convert data to a format suitable for use in a list.

By default, the array values will be used. Implement ListDataInterface to use some other criteria (e.g. array keys).

Parameters

FormatterOptions $options

Return Value

array

protected getReorderedFieldLabels($data, $options, $defaults)

No description

Parameters

$data
$options
$defaults

protected getFields($options, $defaults)

No description

Parameters

$options
$defaults

protected array defaultOptions()

A structured list may provide its own set of default options. These will be used in place of the command's default options (from the annotations) in instances where the user does not provide the options explicitly (on the commandline) or implicitly (via a configuration file).

Return Value

array

setFormatter(FormatterInterface $formatter)

No description

Parameters

FormatterInterface $formatter

getFormatter()

No description

isHumanReadable()

No description

$this addRenderer(RenderCellInterface $renderer, $priority = RenderCellCollectionInterface::PRIORITY_NORMAL)

Add a renderer

Parameters

RenderCellInterface $renderer
$priority

Return Value

$this

$this addRendererFunction(callable $rendererFn, $priority = RenderCellCollectionInterface::PRIORITY_NORMAL)

Add a callable as a renderer

Parameters

callable $rendererFn
$priority

Return Value

$this

renderCell($key, $cellData, FormatterOptions $options, $rowData)

{@inheritdoc}

Parameters

$key
$cellData
FormatterOptions $options
$rowData

restructure(FormatterOptions $options)

Restructure this data for output by converting it into a table transformation object. First, though, remove any metadata items.

Parameters

FormatterOptions $options

Formatting options

protected createTableTransformation($data, $options)

No description

Parameters

$data
$options

protected instantiateTableTransformation($data, $fieldLabels, $rowLabels)

No description

Parameters

$data
$fieldLabels
$rowLabels

convert(FormatterOptions $options)

No description

Parameters

FormatterOptions $options

Formatting options

getDataKey()

No description

setDataKey($key)

No description

Parameters

$key

getMetadataKey()

No description

setMetadataKey($key)

No description

Parameters

$key

extractData($data)

No description

Parameters

$data

extractMetadata($data)

No description

Parameters

$data

reconstruct($data, $metadata)

No description

Parameters

$data
$metadata

getMetadata()

Return the metadata associated with the structured data (if any)