sumTable($subTable); } } /** * Reset this row to an empty one and sums the associated subtable again. */ public function recalculate() { $id = $this->getIdSubDataTable(); if ($id !== null) { $subTable = Manager::getInstance()->getTable($id); $this->sumTable($subTable); } } /** * Sums a tables row with this one. * * @param DataTable $table */ private function sumTable($table) { foreach ($table->getRows() as $row) { $this->sumRow($row, $enableCopyMetadata = false, $table->getMetadata(DataTable::COLUMN_AGGREGATION_OPS_METADATA_NAME)); } } }