src/Subjects/FileWriter/FileWriterFactory.php
/**
     * Creates and returns the file resolver instance for the subject with the passed configuration.
     *
     * @param \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject The subject to create the file resolver for
     *
     * @return \TechDivision\Import\Subjects\FileWriter\FileWriterInterface The file resolver instance
     */
Creates and returns the file resolver instance for the subject with the passed configuration.
@param \TechDivision\Import\Configuration\SubjectConfigurationInterface $subject The subject to create the file resolver for


Creates and returns the file resolver instance for the subject with the passed configuration . @param \ TechDivision \ Import \ Configuration \ SubjectConfigurationInterface $subject The subject to create the file resolver for
public function createFileWriter(SubjectConfigurationInterface $subject) : FileWriterInterface
    {
        $container = $this->getContainer();
        $handler = $this->getHandlerFactory()->createHandler($subject);
        $filesystemAdapter = $container->get($subject->getFilesystemAdapter()->getId());
        if ($filesystemAdapter instanceof FilesystemAdapterFactoryInterface) {
            $filesystemAdapter = $filesystemAdapter->createFilesystemAdapter($subject);
        }
        $fileWriter = $container->get($subject->getFileWriter()->getId());
        $fileWriter->setHandler($handler);
        $fileWriter->setFilesystemAdapter($filesystemAdapter);
        $fileWriter->setFileResolverConfiguration($subject->getFileResolver());
        return $fileWriter;
    }
public function createFileWriter ( SubjectConfigurationInterface $ subject ) : FileWriterInterface { $ container = $ this -> getContainer ( ) ; $ handler = $ this -> getHandlerFactory ( ) -> createHandler ( $ subject ) ; $ filesystemAdapter = $ container -> get ( $ subject -> getFilesystemAdapter ( ) -> getId ( ) ) ; if ( $ filesystemAdapter instanceof FilesystemAdapterFactoryInterface ) { $ filesystemAdapter = $ filesystemAdapter -> createFilesystemAdapter ( $ subject ) ; } $ fileWriter = $ container -> get ( $ subject -> getFileWriter ( ) -> getId ( ) ) ; $ fileWriter -> setHandler ( $ handler ) ; $ fileWriter -> setFilesystemAdapter ( $ filesystemAdapter ) ; $ fileWriter -> setFileResolverConfiguration ( $ subject -> getFileResolver ( ) ) ; return $ fileWriter ; }
Creates and returns the file resolver instance for the subject with the passed configuration.
Creates and returns the file resolver instance for the subject with the passed configuration .
// load the DI container instance // load the proposed .OK file loader // load the filesystem adapter instance /** \TechDivision\Import\Adapter\FilesystemAdapterInterface $filesystemAdapter */ // query whether or not we've a factory instance // create a new file writer instance for the subject with the passed configuration /** @var \TechDivision\Import\Subjects\FileWriter\OkFileAwareFileWriterInterface $fileWriter */ // return the file writer instance