XLSX
- Full name:
\MammothPHP\WoollyM\IO\XLSX - Parent class:
\MammothPHP\WoollyM\IO\Builder
Constants
| Constant | Visibility | Type | Value |
|---|---|---|---|
DEFAULT_SHEET_NAME | public | null | |
DEFAULT_COLROW | public | 1 |
Properties
sheetName
php
public ?string $sheetNamecolRow
php
public int $colRowMethods
import
php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrameParameters:
| Parameter | Type | Description |
|---|---|---|
$to | \MammothPHP\WoollyM\DataFrame |
format
php
public format(?string $sheetName = self::DEFAULT_SHEET_NAME, mixed $colRow = self::DEFAULT_COLROW): staticParameters:
| Parameter | Type | Description |
|---|---|---|
$sheetName | ?string | |
$colRow | mixed | - Parse data after specified line (starting at 1), and consider this line at the header. Set to 0 for no header. |
loadFile
Loads the file which the CSV class was instantiated with.
php
protected loadFile(string $file): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$file | string |
Throws:
getWriter
php
protected getWriter(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet): \PhpOffice\PhpSpreadsheet\Writer\BaseWriterParameters:
| Parameter | Type | Description |
|---|---|---|
$spreadsheet | \PhpOffice\PhpSpreadsheet\Spreadsheet |
toFile
Write an Excel file
php
public toFile(string|\SplFileInfo $file, bool $overwriteFile = false, string $worksheetTitle = 'DataFrame'): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$file | string|\SplFileInfo | |
$overwriteFile | bool | |
$worksheetTitle | string |
toExcelSpreadsheet
Converts the columns and data passed to an XLSX worksheet and adds that worksheet to an instance of PHPExcel
php
public toExcelSpreadsheet(\PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet, string $worksheetTitle = 'DataFrame'): \PhpOffice\PhpSpreadsheet\Worksheet\WorksheetParameters:
| Parameter | Type | Description |
|---|---|---|
$spreadsheet | \PhpOffice\PhpSpreadsheet\Spreadsheet | |
$worksheetTitle | string |
Throws:
Inherited methods
fromFilePath
php
public static fromFilePath(string $path): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$path | string |
fromFileInfo
php
public static fromFileInfo(\SplFileInfo $file): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$file | \SplFileInfo |
fromString
php
public static fromString(string $input): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$input | string |
convertSplFileToString
php
protected convertSplFileToString(): stringimport
php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrame- This method is abstract.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$to | \MammothPHP\WoollyM\DataFrame |
toArray
php
public toArray(): arrayfromDataFrame
php
public static fromDataFrame(\MammothPHP\WoollyM\DataFrame $df): static- This method is static.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$df | \MammothPHP\WoollyM\DataFrame |
prepareToFileInput
php
protected prepareToFileInput(mixed $file, bool $overwriteFile): \SplFileObject|falseParameters:
| Parameter | Type | Description |
|---|---|---|
$file | mixed | |
$overwriteFile | bool |
Automatically generated on 2024-07-03