<?php
namespace ModulesAbstract\PluginReports\Report\Model\Exporter\RowsStorage; class LocalMemory extends RowsStorageAbstract { protected $rows= []; public function appendRow($row) { $report = $row['_report']; unset($row['_report']); $this->rows[$report][] = $row; } public function getTypes() { return array_keys((array)$this->rows); } public function countByType($report) { return count((array)$this->rows[$report]); } public function getAllByType($report) { return (array)$this->rows[$report]; } public function getFirstRowByType($report) { if ($this->rows[$report]) { return reset($this->rows[$report]); } return []; } } 