Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402] [Versions 402 and 403]

(no description)

File Size: 735 lines (27 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: Style  - X-Ref

__construct($isSupervisor = false, $isConditional = false)   X-Ref
Create a new Style.

param: bool $isSupervisor Flag indicating if this is a supervisor or not
param: bool $isConditional Flag indicating if this is a conditional style or not

getSharedComponent()   X-Ref
Get the shared style component for the currently active cell in currently active sheet.
Only used for style supervisor.


getParent()   X-Ref
Get parent. Only used for style supervisor.


getStyleArray($array)   X-Ref
Build style array from subcomponents.

param: array $array
return: array

applyFromArray(array $styleArray, $advancedBorders = true)   X-Ref
Apply styles from array.

<code>
$spreadsheet->getActiveSheet()->getStyle('B2')->applyFromArray(
[
'font' => [
'name' => 'Arial',
'bold' => true,
'italic' => false,
'underline' => Font::UNDERLINE_DOUBLE,
'strikethrough' => false,
'color' => [
'rgb' => '808080'
]
],
'borders' => [
'bottom' => [
'borderStyle' => Border::BORDER_DASHDOT,
'color' => [
'rgb' => '808080'
]
],
'top' => [
'borderStyle' => Border::BORDER_DASHDOT,
'color' => [
'rgb' => '808080'
]
]
],
'alignment' => [
'horizontal' => Alignment::HORIZONTAL_CENTER,
'vertical' => Alignment::VERTICAL_CENTER,
'wrapText' => true,
],
'quotePrefix'    => true
]
);
</code>

param: array $styleArray Array containing style information
param: bool $advancedBorders advanced mode for setting borders
return: $this

getOldXfIndexes(string $selectionType, array $rangeStart, array $rangeEnd, string $columnStart, string $columnEnd, array $styleArray)   X-Ref
No description

getFill()   X-Ref
Get Fill.

return: Fill

getFont()   X-Ref
Get Font.

return: Font

setFont(Font $font)   X-Ref
Set font.

return: $this

getBorders()   X-Ref
Get Borders.

return: Borders

getAlignment()   X-Ref
Get Alignment.

return: Alignment

getNumberFormat()   X-Ref
Get Number Format.

return: NumberFormat

getConditionalStyles()   X-Ref
Get Conditional Styles. Only used on supervisor.

return: Conditional[]

setConditionalStyles(array $conditionalStyleArray)   X-Ref
Set Conditional Styles. Only used on supervisor.

param: Conditional[] $conditionalStyleArray Array of conditional styles
return: $this

getProtection()   X-Ref
Get Protection.

return: Protection

getQuotePrefix()   X-Ref
Get quote prefix.

return: bool

setQuotePrefix($quotePrefix)   X-Ref
Set quote prefix.

param: bool $quotePrefix
return: $this

getHashCode()   X-Ref
Get hash code.

return: string Hash code

getIndex()   X-Ref
Get own index in style collection.

return: int

setIndex($index)   X-Ref
Set own index in style collection.

param: int $index

exportArray1()   X-Ref
No description