public function importData($arElementList, $sSessionKey = null)
    {
        if (empty($arElementList)) {
            return;
        }

        $obImport = new ImportProductModel();
        $obImport->setDeactivateFlag();

        foreach ($arElementList as $iKey => $arImportData) {
            $obImport->import($arImportData);
            $sResultMethod = $obImport->getResultMethod();
            if (in_array($sResultMethod, ['logUpdated', 'logCreated'])) {
                $this->$sResultMethod();
            } else {
                $sErrorMessage = $obImport->getResultError();
                $this->$sResultMethod($iKey, $sErrorMessage);
            }
        }

        $obImport->deactivateElements();
    }
public function importData($arElementList, $sSessionKey = null)
    {
        if (empty($arElementList)) {
            return;
        }

        $obImport = new ImportProductModel();
        $obImport->setDeactivateFlag();

        foreach ($arElementList as $iKey => $arImportData) {
            $obImport->import($arImportData);
            $sResultMethod = $obImport->getResultMethod();
            if (in_array($sResultMethod, ['logUpdated', 'logCreated'])) {
                $this->$sResultMethod();
            } else {
                $sErrorMessage = $obImport->getResultError();
                $this->$sResultMethod($iKey, $sErrorMessage);
            }
        }

        $obImport->deactivateElements();
    }
public function importData ( $ arElementList , $ sSessionKey = null ) { if ( empty ( $ arElementList ) ) { return ; } $ obImport = new ImportProductModel ( ) ; $ obImport -> setDeactivateFlag ( ) ; foreach ( $ arElementList as $ iKey => $ arImportData ) { $ obImport -> import ( $ arImportData ) ; $ sResultMethod = $ obImport -> getResultMethod ( ) ; if ( in_array ( $ sResultMethod , [ 'logUpdated' , 'logCreated' ] ) ) { $ this -> $ sResultMethod ( ) ; } else { $ sErrorMessage = $ obImport -> getResultError ( ) ; $ this -> $ sResultMethod ( $ iKey , $ sErrorMessage ) ; } } $ obImport -> deactivateElements ( ) ; }
Import item list from CSV file
@param array $arElementList
@param null  $sSessionKey
@throws \Throwable
Import item list from CSV file