addRadio('onDuplicate', ts('Import mode'), [ CRM_Import_Parser::DUPLICATE_SKIP => ts('Insert new Membership'), CRM_Import_Parser::DUPLICATE_UPDATE => ts('Update existing Membership'), ]); $this->setDefaults([ 'onDuplicate' => CRM_Import_Parser::DUPLICATE_SKIP, ]); $this->addContactTypeSelector(); } /** * Process the uploaded file. * * @return void */ public function postProcess() { $this->storeFormValues([ 'onDuplicate', 'contactType', 'dateFormats', 'savedMapping', ]); $this->submitFileForMapping('CRM_Member_Import_Parser_Membership'); } /** * @return \CRM_Member_Import_Parser_Membership */ protected function getParser(): CRM_Member_Import_Parser_Membership { if (!$this->parser) { $this->parser = new CRM_Member_Import_Parser_Membership(); $this->parser->setUserJobID($this->getUserJobID()); $this->parser->init(); } return $this->parser; } }