code: public function writeTempToFile(SplTempFileObject &$tmpFile)
      {
          $file = $this->openFile(static::FILE_WRITE);
  
          foreach ($tmpFile as $line) {
              $file->fwrite($line);
          }
  
          $this->closeFile($file);
          $tmpFile = null;
      }
docs: Write temporary file contents to database file.
  
  @param SplTempFileObject $tmpFile