ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($isSupervisor=false, $isConditional=false) | |
Create a new NumberFormat. More... | |
getSharedComponent () | |
Get the shared style component for the currently active cell in currently active sheet. More... | |
getStyleArray ($array) | |
Build style array from subcomponents. More... | |
applyFromArray (array $pStyles) | |
Apply styles from array. More... | |
getFormatCode () | |
Get Format Code. More... | |
setFormatCode ($pValue) | |
Set Format Code. More... | |
getBuiltInFormatCode () | |
Get Built-In Format Code. More... | |
setBuiltInFormatCode ($pValue) | |
Set Built-In Format Code. More... | |
getHashCode () | |
Get hash code. More... | |
![]() | |
__construct ($isSupervisor=false) | |
Create a new Supervisor. More... | |
bindParent ($parent, $parentPropertyName=null) | |
Bind parent. More... | |
getIsSupervisor () | |
Is this a supervisor or a cell style component? More... | |
getActiveSheet () | |
Get the currently active sheet. More... | |
getSelectedCells () | |
Get the currently active cell coordinate in currently active sheet. More... | |
getActiveCell () | |
Get the currently active cell coordinate in currently active sheet. More... | |
__clone () | |
Implement PHP __clone to create a deep clone, not just a shallow copy. More... | |
exportArray () | |
Export style as array. More... | |
getHashCode () | |
Get hash code. More... | |
Static Public Member Functions | |
static | builtInFormatCode ($pIndex) |
Get built-in format code. More... | |
static | builtInFormatCodeIndex ($formatCode) |
Get built-in format code index. More... | |
static | toFormattedString ($value, $format, $callBack=null) |
Convert a value in a pre-defined format to a PHP string. More... | |
Data Fields | |
const | FORMAT_GENERAL = 'General' |
const | FORMAT_TEXT = '@' |
const | FORMAT_NUMBER = '0' |
const | FORMAT_NUMBER_00 = '0.00' |
const | FORMAT_NUMBER_COMMA_SEPARATED1 = '#,##0.00' |
const | FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-' |
const | FORMAT_PERCENTAGE = '0%' |
const | FORMAT_PERCENTAGE_00 = '0.00%' |
const | FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd' |
const | FORMAT_DATE_YYYYMMDD = 'yyyy-mm-dd' |
const | FORMAT_DATE_DDMMYYYY = 'dd/mm/yyyy' |
const | FORMAT_DATE_DMYSLASH = 'd/m/yy' |
const | FORMAT_DATE_DMYMINUS = 'd-m-yy' |
const | FORMAT_DATE_DMMINUS = 'd-m' |
const | FORMAT_DATE_MYMINUS = 'm-yy' |
const | FORMAT_DATE_XLSX14 = 'mm-dd-yy' |
const | FORMAT_DATE_XLSX15 = 'd-mmm-yy' |
const | FORMAT_DATE_XLSX16 = 'd-mmm' |
const | FORMAT_DATE_XLSX17 = 'mmm-yy' |
const | FORMAT_DATE_XLSX22 = 'm/d/yy h:mm' |
const | FORMAT_DATE_DATETIME = 'd/m/yy h:mm' |
const | FORMAT_DATE_TIME1 = 'h:mm AM/PM' |
const | FORMAT_DATE_TIME2 = 'h:mm:ss AM/PM' |
const | FORMAT_DATE_TIME3 = 'h:mm' |
const | FORMAT_DATE_TIME4 = 'h:mm:ss' |
const | FORMAT_DATE_TIME5 = 'mm:ss' |
const | FORMAT_DATE_TIME6 = 'h:mm:ss' |
const | FORMAT_DATE_TIME7 = 'i:s.S' |
const | FORMAT_DATE_TIME8 = 'h:mm:ss;@' |
const | FORMAT_DATE_YYYYMMDDSLASH = 'yyyy/mm/dd;@' |
const | FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-' |
const | FORMAT_CURRENCY_USD = '$#,##0_-' |
const | FORMAT_CURRENCY_EUR_SIMPLE = '#,##0.00_-"€"' |
const | FORMAT_CURRENCY_EUR = '#,##0_-"€"' |
const | FORMAT_ACCOUNTING_USD = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)' |
const | FORMAT_ACCOUNTING_EUR = '_("€"* #,##0.00_);_("€"* \(#,##0.00\);_("€"* "-"??_);_(@_)' |
Protected Member Functions | |
exportArray1 () | |
Abstract method to be implemented in anything which extends this class. More... | |
![]() | |
exportArray1 () | |
Abstract method to be implemented in anything which extends this class. More... | |
exportArray2 (array &$exportedArray, string $index, $objOrValue) | |
Populate array from exportArray1. More... | |
Protected Attributes | |
$formatCode = self::FORMAT_GENERAL | |
$builtInFormatCode = 0 | |
![]() | |
$isSupervisor | |
$parent | |
$parentPropertyName | |
Static Protected Attributes | |
static | $builtInFormats |
static | $flippedBuiltInFormats |
Static Private Member Functions | |
static | fillBuiltInFormatCodes () |
Fill built-in format codes. More... | |
Definition at line 5 of file NumberFormat.php.
PhpOffice\PhpSpreadsheet\Style\NumberFormat::__construct | ( | $isSupervisor = false , |
|
$isConditional = false |
|||
) |
Create a new NumberFormat.
bool | $isSupervisor | Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are |
bool | $isConditional | Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are |
Definition at line 88 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\Supervisor\$isSupervisor, and PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::applyFromArray | ( | array | $pStyles | ) |
Apply styles from array.
$spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray( [ 'formatCode' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE ] );
array | $pStyles | Array containing style information |
Definition at line 137 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\Supervisor\getActiveSheet(), PhpOffice\PhpSpreadsheet\Style\Supervisor\getSelectedCells(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\getStyleArray(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\setFormatCode().
|
static |
Get built-in format code.
int | $pIndex |
Definition at line 334 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\fillBuiltInFormatCodes().
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\__construct(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\getFormatCode(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\getHashCode(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\setBuiltInFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\setFormatCode().
|
static |
Get built-in format code index.
string | $formatCode |
Definition at line 357 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\$formatCode, and PhpOffice\PhpSpreadsheet\Style\NumberFormat\fillBuiltInFormatCodes().
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\setFormatCode().
|
protected |
Abstract method to be implemented in anything which extends this class.
This method invokes exportArray2 with the names and values of all properties to be included in output array, returning that array to exportArray, then to caller.
Reimplemented from PhpOffice\PhpSpreadsheet\Style\Supervisor.
Definition at line 402 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\Supervisor\exportArray2(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getFormatCode().
|
staticprivate |
Fill built-in format codes.
Definition at line 227 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\FORMAT_GENERAL.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCodeIndex().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::getBuiltInFormatCode | ( | ) |
Get Built-In Format Code.
Definition at line 195 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\$builtInFormatCode, and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getSharedComponent().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::getFormatCode | ( | ) |
Get Format Code.
Definition at line 155 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\$formatCode, PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getSharedComponent().
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\exportArray1(), PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormat(), and PhpOffice\PhpSpreadsheet\Writer\Xlsx\Style\writeNumFmt().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::getHashCode | ( | ) |
Get hash code.
Implements PhpOffice\PhpSpreadsheet\IComparable.
Definition at line 375 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getSharedComponent().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::getSharedComponent | ( | ) |
Get the shared style component for the currently active cell in currently active sheet.
Only used for style supervisor.
Definition at line 105 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\getBuiltInFormatCode(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\getFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getHashCode().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::getStyleArray | ( | $array | ) |
Build style array from subcomponents.
array | $array |
Definition at line 117 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\applyFromArray(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\setBuiltInFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\setFormatCode().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::setBuiltInFormatCode | ( | $pValue | ) |
Set Built-In Format Code.
int | $pValue |
Definition at line 211 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode(), PhpOffice\PhpSpreadsheet\Style\Supervisor\getActiveSheet(), PhpOffice\PhpSpreadsheet\Style\Supervisor\getSelectedCells(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getStyleArray().
PhpOffice\PhpSpreadsheet\Style\NumberFormat::setFormatCode | ( | $pValue | ) |
Set Format Code.
string | $pValue | see self::FORMAT_* |
Definition at line 174 of file NumberFormat.php.
References PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCode(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCodeIndex(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\FORMAT_GENERAL, PhpOffice\PhpSpreadsheet\Style\Supervisor\getActiveSheet(), PhpOffice\PhpSpreadsheet\Style\Supervisor\getSelectedCells(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getStyleArray().
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\applyFromArray(), and PhpOffice\PhpSpreadsheet\Reader\Xlsx\Styles\readNumberFormat().
|
static |
Convert a value in a pre-defined format to a PHP string.
mixed | $value | Value to format |
string | $format | Format code, see = self::FORMAT_* |
array | $callBack | Callback function for additional formatting of string |
Definition at line 397 of file NumberFormat.php.
References $format, and PhpOffice\PhpSpreadsheet\Style\NumberFormat\Formatter\toFormattedString().
Referenced by PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\DOLLAR(), PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph\formatDataSetLabels(), PhpOffice\PhpSpreadsheet\Writer\Html\generateRowCellDataValue(), PhpOffice\PhpSpreadsheet\Cell\Cell\getFormattedValue(), and PhpOffice\PhpSpreadsheet\Calculation\TextData\Format\TEXTFORMAT().
|
protected |
Definition at line 76 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\getBuiltInFormatCode().
|
staticprotected |
Definition at line 55 of file NumberFormat.php.
|
staticprotected |
Definition at line 62 of file NumberFormat.php.
|
protected |
Definition at line 69 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\builtInFormatCodeIndex(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\getFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_ACCOUNTING_EUR = '_("€"* #,##0.00_);_("€"* \(#,##0.00\);_("€"* "-"??_);_(@_)' |
Definition at line 48 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_ACCOUNTING_USD = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)' |
Definition at line 47 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR = '#,##0_-"€"' |
Definition at line 46 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE = '#,##0.00_-"€"' |
Definition at line 45 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD = '$#,##0_-' |
Definition at line 44 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_CURRENCY_USD_SIMPLE = '"$"#,##0.00_-' |
Definition at line 43 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\bindValue().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME = 'd/m/yy h:mm' |
Definition at line 32 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DDMMYYYY = 'dd/mm/yyyy' |
Definition at line 22 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMMINUS = 'd-m' |
Definition at line 25 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYMINUS = 'd-m-yy' |
Definition at line 24 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DMYSLASH = 'd/m/yy' |
Definition at line 23 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_MYMINUS = 'm-yy' |
Definition at line 26 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME1 = 'h:mm AM/PM' |
Definition at line 33 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME2 = 'h:mm:ss AM/PM' |
Definition at line 34 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME3 = 'h:mm' |
Definition at line 35 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode(), and PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\setTimeHoursMinutes().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME4 = 'h:mm:ss' |
Definition at line 36 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode(), and PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\setTimeHoursMinutesSeconds().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME5 = 'mm:ss' |
Definition at line 37 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME6 = 'h:mm:ss' |
Definition at line 38 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME7 = 'i:s.S' |
Definition at line 39 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_TIME8 = 'h:mm:ss;@' |
Definition at line 40 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX14 = 'mm-dd-yy' |
Definition at line 27 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX15 = 'd-mmm-yy' |
Definition at line 28 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX16 = 'd-mmm' |
Definition at line 29 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX17 = 'mmm-yy' |
Definition at line 30 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_XLSX22 = 'm/d/yy h:mm' |
Definition at line 31 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD = 'yyyy-mm-dd' |
Definition at line 21 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd' |
Definition at line 20 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_YYYYMMDDSLASH = 'yyyy/mm/dd;@' |
Definition at line 41 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_GENERAL = 'General' |
Definition at line 8 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\fillBuiltInFormatCodes(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\NumberFormatter\format(), PhpOffice\PhpSpreadsheet\Shared\Date\isDateTimeFormatCode(), PhpOffice\PhpSpreadsheet\Style\NumberFormat\setFormatCode(), and PhpOffice\PhpSpreadsheet\Style\NumberFormat\Formatter\toFormattedString().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER = '0' |
Definition at line 12 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_00 = '0.00' |
Definition at line 13 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1 = '#,##0.00' |
Definition at line 14 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED2 = '#,##0.00_-' |
Definition at line 15 of file NumberFormat.php.
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE = '0%' |
Definition at line 17 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\PercentageFormatter\format().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_PERCENTAGE_00 = '0.00%' |
Definition at line 18 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder\setPercentage().
const PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_TEXT = '@' |
Definition at line 10 of file NumberFormat.php.
Referenced by PhpOffice\PhpSpreadsheet\Style\NumberFormat\Formatter\toFormattedString().