classes/helper/AbstractImportModel.php
public function deactivateElements()
    {
        if (!$this->bDeactivate) {
            return;
        }

        $arDeactivateIDList = array_diff((array) $this->arExistIDList, (array) $this->arProcessedIDList);
        if (empty($arDeactivateIDList)) {
            return;
        }

        //Get element list
        $sModelClass = $this->getModelClass();
        $obElementList = $sModelClass::whereIn('external_id', $arDeactivateIDList)->get();
        foreach ($obElementList as $obElement) {
            $obElement->active = false;
            $obElement->save();
        }
    }
public function deactivateElements()
    {
        if (!$this->bDeactivate) {
            return;
        }

        $arDeactivateIDList = array_diff((array) $this->arExistIDList, (array) $this->arProcessedIDList);
        if (empty($arDeactivateIDList)) {
            return;
        }

        //Get element list
        $sModelClass = $this->getModelClass();
        $obElementList = $sModelClass::whereIn('external_id', $arDeactivateIDList)->get();
        foreach ($obElementList as $obElement) {
            $obElement->active = false;
            $obElement->save();
        }
    }
public function deactivateElements ( ) { if ( ! $ this -> bDeactivate ) { return ; } $ arDeactivateIDList = array_diff ( ( array ) $ this -> arExistIDList , ( array ) $ this -> arProcessedIDList ) ; if ( empty ( $ arDeactivateIDList ) ) { return ; } //Get element list $ sModelClass = $ this -> getModelClass ( ) ; $ obElementList = $ sModelClass :: whereIn ( 'external_id' , $ arDeactivateIDList ) -> get ( ) ; foreach ( $ obElementList as $ obElement ) { $ obElement -> active = false ; $ obElement -> save ( ) ; } }
Deactivate active elements
Deactivate active elements