2 namespace Consolidation\OutputFormatters\StructuredData;
4 use Consolidation\OutputFormatters\Options\FormatterOptions;
7 * Holds an array where each element of the array is one row,
8 * and each row contains an associative array where the keys
9 * are the field names, and the values are the field data.
11 * It is presumed that every row contains the same keys.
13 class RowsOfFields extends AbstractStructuredList
16 * Restructure this data for output by converting it into a table
17 * transformation object.
19 * @param FormatterOptions $options Options that affect output formatting.
20 * @return Consolidation\OutputFormatters\Transformations\TableTransformation
22 public function restructure(FormatterOptions $options)
24 $data = $this->getArrayCopy();
25 return $this->createTableTransformation($data, $options);
28 public function getListData(FormatterOptions $options)
30 return array_keys($this->getArrayCopy());
33 protected function defaultOptions()
36 FormatterOptions::LIST_ORIENTATION => false,
37 ] + parent::defaultOptions();