You are here

protected function Exporter::getDataAsTransformedArray in Loft Data Grids 7.2

Convert ExportData to an array transforming every cell.

Parameters

mixed $page_id The page id from which to pull data or: empty for all pages.

mixed $page_id_key If $page_id is provided, set this to the: key value to use to indicate the page id, for example JSON keeps this as NULL and XML uses the page id.

Return value

array

See also

$this->dataTransform().

5 calls to Exporter::getDataAsTransformedArray()
ArrayExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ArrayExporter.php
Build the string content of $this->output and return $this for chaining.
BootstrapHTMLExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/BootstrapHTMLExporter.php
Build the string content of $this->output and return $this for chaining.
JSONExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/JSONExporter.php
Build the string content of $this->output and return $this for chaining.
XMLExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/XMLExporter.php
Build the string content of $this->output and return $this for chaining.
YAMLExporter::compile in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/YAMLExporter.php
Build the string content of $this->output and return $this for chaining.

File

vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/Exporter.php, line 317

Class

Exporter
Class Exporter

Namespace

AKlump\LoftDataGrids

Code

protected function getDataAsTransformedArray($page_id = null, $page_id_key = null) {
  $data = $this
    ->getData()
    ->get();
  if (!is_null($page_id)) {
    $data = is_null($page_id_key) ? array(
      $data[$page_id],
    ) : array(
      $page_id_key => $data[$page_id],
    );
  }
  foreach ($data as &$page) {
    foreach ($page as &$row) {
      foreach ($row as &$cell) {
        $this
          ->dataTransform($cell);
      }
    }
  }
  return $data;
}