Definition at line 53 of file SimpleExcel.php.
◆ __construct()
SimpleExcel\SimpleExcel::__construct |
( |
|
$filetype = 'XML' | ) |
|
SimpleExcel constructor method.
- Parameters
-
string | $filetype | Set the filetype of the file which will be parsed (XML/CSV/TSV/HTML/JSON) |
- Returns
- void
Definition at line 80 of file SimpleExcel.php.
80 {
83 }
constructParser($filetype)
Construct a SimpleExcel Parser.
constructWriter($filetype)
Construct a SimpleExcel Writer.
◆ constructParser()
SimpleExcel\SimpleExcel::constructParser |
( |
|
$filetype | ) |
|
Construct a SimpleExcel Parser.
- Parameters
-
string | $filetype | Set the filetype of the file which will be parsed (XML/CSV/TSV/HTML/JSON) |
- Exceptions
-
Exception | If filetype is neither XML/CSV/TSV/HTML/JSON |
Definition at line 91 of file SimpleExcel.php.
91 {
92 $filetype = strtoupper($filetype);
93 if(!in_array($filetype, $this->validParserTypes)){
95 }
96 $parser_class = 'SimpleExcel\\Parser\\'.$filetype.'Parser';
97 $this->parser = new $parser_class();
98 }
const FILETYPE_NOT_SUPPORTED
References SimpleExcel\Exception\SimpleExcelException\FILETYPE_NOT_SUPPORTED.
◆ constructWriter()
SimpleExcel\SimpleExcel::constructWriter |
( |
|
$filetype | ) |
|
Construct a SimpleExcel Writer.
- Parameters
-
string | $filetype | Set the filetype of the file which will be written (XML/CSV/TSV/HTML/JSON) |
- Returns
- bool
- Exceptions
-
Exception | If filetype is neither XML/CSV/TSV/HTML/JSON |
Definition at line 107 of file SimpleExcel.php.
107 {
108 $filetype = strtoupper($filetype);
109
110 if(!in_array($filetype, $this->validWriterTypes)){
112 }
113 $writer_class = 'SimpleExcel\\Writer\\'.$filetype.'Writer';
114 $this->writer = new $writer_class();
115 }
References SimpleExcel\Exception\SimpleExcelException\FILETYPE_NOT_SUPPORTED.
◆ convertTo()
SimpleExcel\SimpleExcel::convertTo |
( |
|
$filetype | ) |
|
Change writer type to convert to another format.
- Parameters
-
string | $filetype | Set the filetype of the file which will be written (XML/CSV/TSV/HTML/JSON) |
Definition at line 122 of file SimpleExcel.php.
122 {
124 $this->writer->setData($this->parser->getField());
125 }
◆ $parser
SimpleExcel\SimpleExcel::$parser |
◆ $validParserTypes
SimpleExcel\SimpleExcel::$validParserTypes = array('XML', 'CSV', 'TSV', 'HTML', 'JSON') |
|
protected |
◆ $validWriterTypes
SimpleExcel\SimpleExcel::$validWriterTypes = array('XML', 'CSV', 'TSV', 'HTML', 'JSON') |
|
protected |
◆ $writer
SimpleExcel\SimpleExcel::$writer |
The documentation for this class was generated from the following file: