isRevenueEvolution = $this->getName() == 'revenue_evolution'; } public function compute(Row $row) { $columnName = $this->getWrappedName(); $currentValue = $this->getMetric($row, $columnName); // if the site this is for doesn't support ecommerce & this is for the revenue_evolution column, // we don't add the new column if ($currentValue === false || !$this->isRevenueEvolution) { $idSite = $row->getMetadata('idsite'); if (!$idSite || !Site::isEcommerceEnabledFor($idSite)) { $row->deleteColumn($columnName); return false; } } return parent::compute($row); } }