public function openToFile($outputFilePath)
    {
        $this->outputFilePath = $outputFilePath;

        $this->filePointer = $this->globalFunctionsHelper->fopen($this->outputFilePath, 'wb+');
        $this->throwIfFilePointerIsNotAvailable();

        $this->openWriter();
        $this->isWriterOpened = true;

        return $this;
    }
public function openToFile($outputFilePath)
    {
        $this->outputFilePath = $outputFilePath;

        $this->filePointer = $this->globalFunctionsHelper->fopen($this->outputFilePath, 'wb+');
        $this->throwIfFilePointerIsNotAvailable();

        $this->openWriter();
        $this->isWriterOpened = true;

        return $this;
    }
public function openToFile ( $ outputFilePath ) { $ this -> outputFilePath = $ outputFilePath ; $ this -> filePointer = $ this -> globalFunctionsHelper -> fopen ( $ this -> outputFilePath , 'wb+' ) ; $ this -> throwIfFilePointerIsNotAvailable ( ) ; $ this -> openWriter ( ) ; $ this -> isWriterOpened = true ; return $ this ; }
Inits the writer and opens it to accept data.
By using this method, the data will be written to a file.

@api
@param  string $outputFilePath Path of the output file that will contain the data
@return AbstractWriter
@throws \Box\Spout\Common\Exception\IOException If the writer cannot be opened or if the given path is not writable
Inits the writer and opens it to accept data . By using this method the data will be written to a file .