Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

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

Defines 1 class

Alignment:: (20 methods):
  __construct()
  getSharedComponent()
  getStyleArray()
  applyFromArray()
  getHorizontal()
  setHorizontal()
  getVertical()
  setVertical()
  getTextRotation()
  setTextRotation()
  getWrapText()
  setWrapText()
  getShrinkToFit()
  setShrinkToFit()
  getIndent()
  setIndent()
  getReadOrder()
  setReadOrder()
  getHashCode()
  exportArray1()


Class: Alignment  - X-Ref

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

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.

return: Alignment

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

param: array $array
return: array

applyFromArray(array $styleArray)   X-Ref
Apply styles from array.

<code>
$spreadsheet->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray(
[
'horizontal'   => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
'vertical'     => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
'textRotation' => 0,
'wrapText'     => TRUE
]
);
</code>

param: array $styleArray Array containing style information
return: $this

getHorizontal()   X-Ref
Get Horizontal.

return: null|string

setHorizontal(string $horizontalAlignment)   X-Ref
Set Horizontal.

param: string $horizontalAlignment see self::HORIZONTAL_*
return: $this

getVertical()   X-Ref
Get Vertical.

return: null|string

setVertical($verticalAlignment)   X-Ref
Set Vertical.

param: string $verticalAlignment see self::VERTICAL_*
return: $this

getTextRotation()   X-Ref
Get TextRotation.

return: null|int

setTextRotation($angleInDegrees)   X-Ref
Set TextRotation.

param: int $angleInDegrees
return: $this

getWrapText()   X-Ref
Get Wrap Text.

return: bool

setWrapText($wrapped)   X-Ref
Set Wrap Text.

param: bool $wrapped
return: $this

getShrinkToFit()   X-Ref
Get Shrink to fit.

return: bool

setShrinkToFit($shrink)   X-Ref
Set Shrink to fit.

param: bool $shrink
return: $this

getIndent()   X-Ref
Get indent.

return: int

setIndent($indent)   X-Ref
Set indent.

param: int $indent
return: $this

getReadOrder()   X-Ref
Get read order.

return: int

setReadOrder($readOrder)   X-Ref
Set read order.

param: int $readOrder
return: $this

getHashCode()   X-Ref
Get hash code.

return: string Hash code

exportArray1()   X-Ref
No description