protected function initParentCategory()
    {
        if (!array_key_exists('parent_id', $this->arImportData)) {
            return;
        }

        $iParentID = array_get($this->arImportData, 'parent_id');
        array_forget($this->arImportData, 'parent_id');
        if (empty($iParentID)) {
            $this->obParentCategory = false;

            return;
        }

        //Find parent category
        $this->obParentCategory = Category::getByExternalID($iParentID)->first();
    }
protected function initParentCategory()
    {
        if (!array_key_exists('parent_id', $this->arImportData)) {
            return;
        }

        $iParentID = array_get($this->arImportData, 'parent_id');
        array_forget($this->arImportData, 'parent_id');
        if (empty($iParentID)) {
            $this->obParentCategory = false;

            return;
        }

        //Find parent category
        $this->obParentCategory = Category::getByExternalID($iParentID)->first();
    }
protected function initParentCategory ( ) { if ( ! array_key_exists ( 'parent_id' , $ this -> arImportData ) ) { return ; } $ iParentID = array_get ( $ this -> arImportData , 'parent_id' ) ; array_forget ( $ this -> arImportData , 'parent_id' ) ; if ( empty ( $ iParentID ) ) { $ this -> obParentCategory = false ; return ; } //Find parent category $ this -> obParentCategory = Category :: getByExternalID ( $ iParentID ) -> first ( ) ; }
Find parent category by external ID and set parent_id
Find parent category by external ID and set parent_id