You are here

public function ExportData::getCurrent in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ExportData.php \AKlump\LoftDataGrids\ExportData::getCurrent()

Return the current record or data by key

Parameters

string $key: (Optional) Defaults to NULL. If excluded the entire current record will be returned. If included the value of the current row at $key will be returned.

Return value

array | mixed

Overrides ExportDataInterface::getCurrent

1 call to ExportData::getCurrent()
ExportData::getValue in vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ExportData.php
Return the value of a single column, single row by key.

File

vendor/aklump/loft_data_grids/src/AKlump/LoftDataGrids/ExportData.php, line 267

Class

ExportData

Namespace

AKlump\LoftDataGrids

Code

public function getCurrent($key = NULL) {
  $current_pointer = $this
    ->getPointer();
  $data = $this
    ->get();
  $data = isset($data[$this->current_page][$current_pointer]) ? $data[$this->current_page][$current_pointer] : array();
  if ($key === NULL) {
    return $data;
  }
  return array_key_exists($key, $data) ? $data[$key] : NULL;
}