src/Loaders/ProposedOkFilenameLoaderFactory.php
/**
     * Create's and return's the apropriate loader instance.
     *
     * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface|null $subject The suject configuration instance
     *
     * @return \TechDivision\Import\Loaders\LoaderInterface The loader instance
     */
Create's and return's the apropriate loader instance.
@param \TechDivision\Import\Configuration\SubjectConfigurationInterface|null $subject The suject configuration instance


Create ' s and return ' s the apropriate loader instance . @param \ TechDivision \ Import \ Configuration \ SubjectConfigurationInterface|null $subject The suject configuration instance
public function createLoader(SubjectConfigurationInterface $subject = null) : LoaderInterface
    {
        $filesystemAdapter = $this->getContainer()->get($subject->getFilesystemAdapter()->getId());
        if ($filesystemAdapter instanceof FilesystemAdapterFactoryInterface) {
            $filesystemAdapter = $filesystemAdapter->createFilesystemAdapter($subject);
        }
        $filesystemLoader = new FilesystemLoader($filesystemAdapter);
        $filteredLoader = new FilteredLoader($filesystemLoader);
        $pregMatchFilteredLoader = new PregMatchFilteredLoader($filteredLoader);
        $proposedOkFileLoader = new ProposedOkFilenameLoader($pregMatchFilteredLoader);
        $proposedOkFileLoader->addFilter(new DefaultOkFileFilter($subject));
        $proposedOkFileLoader->addSorter(new DefaultOkFileSorter());
        $proposedOkFileLoader->setSourceDir($this->getSourceDir($filesystemAdapter));
        $proposedOkFileLoader->setFileResolverConfiguration($subject->getFileResolver());
        return $proposedOkFileLoader;
    }
public function createLoader ( SubjectConfigurationInterface $ subject = null ) : LoaderInterface { $ filesystemAdapter = $ this -> getContainer ( ) -> get ( $ subject -> getFilesystemAdapter ( ) -> getId ( ) ) ; if ( $ filesystemAdapter instanceof FilesystemAdapterFactoryInterface ) { $ filesystemAdapter = $ filesystemAdapter -> createFilesystemAdapter ( $ subject ) ; } $ filesystemLoader = new FilesystemLoader ( $ filesystemAdapter ) ; $ filteredLoader = new FilteredLoader ( $ filesystemLoader ) ; $ pregMatchFilteredLoader = new PregMatchFilteredLoader ( $ filteredLoader ) ; $ proposedOkFileLoader = new ProposedOkFilenameLoader ( $ pregMatchFilteredLoader ) ; $ proposedOkFileLoader -> addFilter ( new DefaultOkFileFilter ( $ subject ) ) ; $ proposedOkFileLoader -> addSorter ( new DefaultOkFileSorter ( ) ) ; $ proposedOkFileLoader -> setSourceDir ( $ this -> getSourceDir ( $ filesystemAdapter ) ) ; $ proposedOkFileLoader -> setFileResolverConfiguration ( $ subject -> getFileResolver ( ) ) ; return $ proposedOkFileLoader ; }
Create's and return's the apropriate loader instance.
Create ' s and return ' s the apropriate loader instance .
// load the filesystem adapter instance // query whether or not we've a factory instance // initialize the chain with the loader instances // return the new loader instance