classes/item/ElementItem.php
protected function setCachedFieldList()
    {
        if (!method_exists($this->obElement, 'getCachedField')) {
            return;
        }

        //Get cached field list
        $arFieldList = $this->obElement->getCachedField();
        if (empty($arFieldList)) {
            return;
        }

        foreach ($arFieldList as $sField) {
            if (array_key_exists($sField, (array) $this->obElement->attachOne)) {
                $arFileData = $this->getUploadFileData($this->obElement->$sField);
                $sFieldName = 'attachOne|'.$sField;
                $this->setAttribute($sFieldName, $arFileData);
            } elseif (array_key_exists($sField, (array) $this->obElement->attachMany)) {
                $arFileList = [];
                $obFileList = $this->obElement->$sField;
                foreach ($obFileList as $obFile) {
                    $arFileData = $this->getUploadFileData($obFile);
                    $arFileList[] = $arFileData;
                }

                $sFieldName = 'attachMany|'.$sField;
                $this->setAttribute($sFieldName, $arFileList);
            } else {
                $this->setAttribute($sField, $this->obElement->$sField);
            }
        }
    }
protected function setCachedFieldList()
    {
        if (!method_exists($this->obElement, 'getCachedField')) {
            return;
        }

        //Get cached field list
        $arFieldList = $this->obElement->getCachedField();
        if (empty($arFieldList)) {
            return;
        }

        foreach ($arFieldList as $sField) {
            if (array_key_exists($sField, (array) $this->obElement->attachOne)) {
                $arFileData = $this->getUploadFileData($this->obElement->$sField);
                $sFieldName = 'attachOne|'.$sField;
                $this->setAttribute($sFieldName, $arFileData);
            } elseif (array_key_exists($sField, (array) $this->obElement->attachMany)) {
                $arFileList = [];
                $obFileList = $this->obElement->$sField;
                foreach ($obFileList as $obFile) {
                    $arFileData = $this->getUploadFileData($obFile);
                    $arFileList[] = $arFileData;
                }

                $sFieldName = 'attachMany|'.$sField;
                $this->setAttribute($sFieldName, $arFileList);
            } else {
                $this->setAttribute($sField, $this->obElement->$sField);
            }
        }
    }
protected function setCachedFieldList ( ) { if ( ! method_exists ( $ this -> obElement , 'getCachedField' ) ) { return ; } //Get cached field list $ arFieldList = $ this -> obElement -> getCachedField ( ) ; if ( empty ( $ arFieldList ) ) { return ; } foreach ( $ arFieldList as $ sField ) { if ( array_key_exists ( $ sField , ( array ) $ this -> obElement -> attachOne ) ) { $ arFileData = $ this -> getUploadFileData ( $ this -> obElement -> $ sField ) ; $ sFieldName = 'attachOne|' . $ sField ; $ this -> setAttribute ( $ sFieldName , $ arFileData ) ; } elseif ( array_key_exists ( $ sField , ( array ) $ this -> obElement -> attachMany ) ) { $ arFileList = [ ] ; $ obFileList = $ this -> obElement -> $ sField ; foreach ( $ obFileList as $ obFile ) { $ arFileData = $ this -> getUploadFileData ( $ obFile ) ; $ arFileList [ ] = $ arFileData ; } $ sFieldName = 'attachMany|' . $ sField ; $ this -> setAttribute ( $ sFieldName , $ arFileList ) ; } else { $ this -> setAttribute ( $ sField , $ this -> obElement -> $ sField ) ; } } }
Get cached field list from model and add fields to cache array
Get cached field list from model and add fields to cache array