function variant_el($newParams, $newName = NULL) { assert('is_array($this->cache["params"])'); if ($newName === NULL) { $newName = $this->name; } list($rpt, $err) = Report::create_e($this->cache['type'], $newName); if ($err) { Fatal::internalError("Unexpected report creation error: " . $err->toStr()); } $params = new Params(); $params->loadDict($this->cache['params']); $errs = $params->load_el($rpt->rpt->paramDefs(), $newParams); if (!empty($errs)) { return array(NULL, $errs); } $errs = $rpt->_init_el($params); if (!empty($errs)) { return array(NULL, $errs); } return array($rpt, array()); }