protected function initAdditionalCategoryField()
    {
        $sCategoryList = array_get($this->arImportData, 'additional_category');
        if ($sCategoryList === null) {
            return;
        }

        $arCategoryIDList = explode(',', $sCategoryList);
        foreach ($arCategoryIDList as $iKey => &$iCategoryID) {
            $iCategoryID = trim($iCategoryID);
            if (empty($iCategoryID)) {
                unset($arCategoryIDList[$iKey]);
            }
        }

        if (empty($arCategoryIDList)) {
            $this->arAdditionalCategoryList = [];

            return;
        }

        $this->arAdditionalCategoryList = (array) Category::whereIn('external_id', $arCategoryIDList)->lists('id');
    }
protected function initAdditionalCategoryField()
    {
        $sCategoryList = array_get($this->arImportData, 'additional_category');
        if ($sCategoryList === null) {
            return;
        }

        $arCategoryIDList = explode(',', $sCategoryList);
        foreach ($arCategoryIDList as $iKey => &$iCategoryID) {
            $iCategoryID = trim($iCategoryID);
            if (empty($iCategoryID)) {
                unset($arCategoryIDList[$iKey]);
            }
        }

        if (empty($arCategoryIDList)) {
            $this->arAdditionalCategoryList = [];

            return;
        }

        $this->arAdditionalCategoryList = (array) Category::whereIn('external_id', $arCategoryIDList)->lists('id');
    }
protected function initAdditionalCategoryField ( ) { $ sCategoryList = array_get ( $ this -> arImportData , 'additional_category' ) ; if ( $ sCategoryList === null ) { return ; } $ arCategoryIDList = explode ( ',' , $ sCategoryList ) ; foreach ( $ arCategoryIDList as $ iKey => & $ iCategoryID ) { $ iCategoryID = trim ( $ iCategoryID ) ; if ( empty ( $ iCategoryID ) ) { unset ( $ arCategoryIDList [ $ iKey ] ) ; } } if ( empty ( $ arCategoryIDList ) ) { $ this -> arAdditionalCategoryList = [ ] ; return ; } $ this -> arAdditionalCategoryList = ( array ) Category :: whereIn ( 'external_id' , $ arCategoryIDList ) -> lists ( 'id' ) ; }
Init additional category ID list
Init additional category ID list