src/Subjects/FileResolver/OkFileAwareFileResolver.php
/**
     * Loads the files from the source directory and return's them sorted.
     *
     * @param string $serial The unique identifier of the actual import process
     *
     * @return array The array with the files matching the subjects suffix
     * @throws \Exception Is thrown, when the source directory is NOT available
     * @throws \TechDivision\Import\Exceptions\MissingOkFileException Is thrown, if files to be processed are available but the mandatory OK file is missing
     */
Loads the files from the source directory and return's them sorted.
@param string $serial The unique identifier of the actual import process


Loads the files from the source directory and return ' s them sorted . @param string $serial The unique identifier of the actual import process
public function loadFiles(string $serial) : array
    {
        $filesToHandle = parent::loadFiles($serial);
        $sizeBeforeFiltersHaveBeenApplied = $this->getFilesystemLoader()->getSizeBeforeFiltersHaveBeenApplied();
        if ($this->getSubjectConfiguration()->isOkFileNeeded() && $sizeBeforeFiltersHaveBeenApplied > 0 && sizeof($filesToHandle) === 0) {
            throw new MissingOkFileException(
                sprintf(
                    'Stop processing, because can\'t find the mandatory OK file for "%s" to process at least one of %d files',
                    $this->getSubjectConfiguration()->getFileResolver()->getPrefix(),
                    $sizeBeforeFiltersHaveBeenApplied
                )
            );
        }
        return $filesToHandle;
    }
public function loadFiles ( string $ serial ) : array { $ filesToHandle = parent :: loadFiles ( $ serial ) ; $ sizeBeforeFiltersHaveBeenApplied = $ this -> getFilesystemLoader ( ) -> getSizeBeforeFiltersHaveBeenApplied ( ) ; if ( $ this -> getSubjectConfiguration ( ) -> isOkFileNeeded ( ) && $ sizeBeforeFiltersHaveBeenApplied > 0 && sizeof ( $ filesToHandle ) === 0 ) { throw new MissingOkFileException ( sprintf ( 'Stop processing, because can\'t find the mandatory OK file for "%s" to process at least one of %d files' , $ this -> getSubjectConfiguration ( ) -> getFileResolver ( ) -> getPrefix ( ) , $ sizeBeforeFiltersHaveBeenApplied ) ) ; } return $ filesToHandle ; }
Loads the files from the source directory and return's them sorted.
Loads the files from the source directory and return ' s them sorted .
// initialize the array with the files that has to be handled // load the size of the files before the filters have been applied // stop processing, if files ARE available, an OK file IS mandatory, but // NO file will be processed (because of a missing/not matching OK file) // return the array with the files that has to be handled