classes/helper/AbstractImportModel.php
protected function initImageList()
    {
        if (!array_key_exists('images', $this->arImportData)) {
            $this->bNeedUpdateImageList = false;
            return;
        }

        $this->bNeedUpdateImageList = true;
        $this->arImageList = explode(',', array_get($this->arImportData, 'images'));
        array_forget($this->arImportData, 'images');

        if (empty($this->arImageList)) {
            return;
        }

        foreach ($this->arImageList as $iKey => $sPath) {
            $sPath = trim($sPath);
            if (empty($sPath)) {
                unset($this->arImageList[$iKey]);
                continue;
            }

            $sFilePath = storage_path($sPath);
            if (!file_exists($sFilePath)) {
                unset($this->arImageList[$iKey]);
            } else {
                $this->arImageList[$iKey] = $sFilePath;
            }
        }
    }
protected function initImageList()
    {
        if (!array_key_exists('images', $this->arImportData)) {
            $this->bNeedUpdateImageList = false;
            return;
        }

        $this->bNeedUpdateImageList = true;
        $this->arImageList = explode(',', array_get($this->arImportData, 'images'));
        array_forget($this->arImportData, 'images');

        if (empty($this->arImageList)) {
            return;
        }

        foreach ($this->arImageList as $iKey => $sPath) {
            $sPath = trim($sPath);
            if (empty($sPath)) {
                unset($this->arImageList[$iKey]);
                continue;
            }

            $sFilePath = storage_path($sPath);
            if (!file_exists($sFilePath)) {
                unset($this->arImageList[$iKey]);
            } else {
                $this->arImageList[$iKey] = $sFilePath;
            }
        }
    }
protected function initImageList ( ) { if ( ! array_key_exists ( 'images' , $ this -> arImportData ) ) { $ this -> bNeedUpdateImageList = false ; return ; } $ this -> bNeedUpdateImageList = true ; $ this -> arImageList = explode ( ',' , array_get ( $ this -> arImportData , 'images' ) ) ; array_forget ( $ this -> arImportData , 'images' ) ; if ( empty ( $ this -> arImageList ) ) { return ; } foreach ( $ this -> arImageList as $ iKey => $ sPath ) { $ sPath = trim ( $ sPath ) ; if ( empty ( $ sPath ) ) { unset ( $ this -> arImageList [ $ iKey ] ) ; continue ; } $ sFilePath = storage_path ( $ sPath ) ; if ( ! file_exists ( $ sFilePath ) ) { unset ( $ this -> arImageList [ $ iKey ] ) ; } else { $ this -> arImageList [ $ iKey ] = $ sFilePath ; } } }
Init image list
Init image list