PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.0
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / vendor / openspout / openspout / src / Writer / XLSX / Writer.php

Writer.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.0, at vendor/openspout/openspout/src/Writer/XLSX/Writer.php

64 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\OpenSpout\Writer\XLSX;
4
5 use FluentCart\OpenSpout\Writer\Common\Entity\Options;
6 use FluentCart\OpenSpout\Writer\WriterMultiSheetsAbstract;
7 /**
8 * This class provides base support to write data to XLSX files.
9 */
10 class Writer extends WriterMultiSheetsAbstract
11 {
12 /** @var string Content-Type value for the header */
13 protected static $headerContentType = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
14 /**
15 * Sets a custom temporary folder for creating intermediate files/folders.
16 * This must be set before opening the writer.
17 *
18 * @param string $tempFolder Temporary folder where the files to create the XLSX will be stored
19 *
20 * @throws \OpenSpout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened
21 *
22 * @return Writer
23 */
24 public function setTempFolder($tempFolder)
25 {
26 $this->throwIfWriterAlreadyOpened('Writer must be configured before opening it.');
27 $this->optionsManager->setOption(Options::TEMP_FOLDER, $tempFolder);
28 return $this;
29 }
30 /**
31 * Use inline string to be more memory efficient. If set to false, it will use shared strings.
32 * This must be set before opening the writer.
33 *
34 * @param bool $shouldUseInlineStrings Whether inline or shared strings should be used
35 *
36 * @throws \OpenSpout\Writer\Exception\WriterAlreadyOpenedException If the writer was already opened
37 *
38 * @return Writer
39 */
40 public function setShouldUseInlineStrings($shouldUseInlineStrings)
41 {
42 $this->throwIfWriterAlreadyOpened('Writer must be configured before opening it.');
43 $this->optionsManager->setOption(Options::SHOULD_USE_INLINE_STRINGS, $shouldUseInlineStrings);
44 return $this;
45 }
46 /**
47 * Merge cells.
48 * Row coordinates are indexed from 1, columns from 0 (A = 0),
49 * so a merge B2:G2 looks like $writer->mergeCells([1,2], [6, 2]);.
50 *
51 * You may use CellHelper::getColumnLettersFromColumnIndex() to convert from "B2" to "[1,2]"
52 *
53 * @param int[] $range1 - top left cell's coordinate [column, row]
54 * @param int[] $range2 - bottom right cell's coordinate [column, row]
55 *
56 * @return $this
57 */
58 public function mergeCells(array $range1, array $range2)
59 {
60 $this->optionsManager->addOption(Options::MERGE_CELLS, [$range1, $range2]);
61 return $this;
62 }
63 }
64