X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FStructuredData%2FPropertyList.php;fp=vendor%2Fconsolidation%2Foutput-formatters%2Fsrc%2FStructuredData%2FPropertyList.php;h=8a34225027e9a42e4db695dc6cb7b857c03d23b3;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/consolidation/output-formatters/src/StructuredData/PropertyList.php b/vendor/consolidation/output-formatters/src/StructuredData/PropertyList.php new file mode 100644 index 000000000..8a3422502 --- /dev/null +++ b/vendor/consolidation/output-formatters/src/StructuredData/PropertyList.php @@ -0,0 +1,58 @@ +getArrayCopy()]; + $options->setConfigurationDefault('list-orientation', true); + $tableTransformer = $this->createTableTransformation($data, $options); + return $tableTransformer; + } + + public function getListData(FormatterOptions $options) + { + $data = $this->getArrayCopy(); + + $defaults = $this->defaultOptions(); + $fieldLabels = $this->getReorderedFieldLabels([$data], $options, $defaults); + + $result = []; + foreach ($fieldLabels as $id => $label) { + $result[$id] = $data[$id]; + } + return $result; + } + + protected function defaultOptions() + { + return [ + FormatterOptions::LIST_ORIENTATION => true, + ] + parent::defaultOptions(); + } + + protected function instantiateTableTransformation($data, $fieldLabels, $rowLabels) + { + return new PropertyListTableTransformation($data, $fieldLabels, $rowLabels); + } +}