Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
PhpOffice\PhpSpreadsheet\Style\Borders Class Reference
Inheritance diagram for PhpOffice\PhpSpreadsheet\Style\Borders:
PhpOffice\PhpSpreadsheet\Style\Supervisor PhpOffice\PhpSpreadsheet\IComparable

Public Member Functions

 __construct (bool $isSupervisor=false, bool $isConditional=false)
 Create a new Borders.
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy.
 
 applyFromArray (array $styleArray)
 Apply styles from array.
 
 bindParent (Spreadsheet|self $parent, ?string $parentPropertyName=null)
 Bind parent.
 
 exportArray ()
 Export style as array.
 
 getActiveCell ()
 Get the currently active cell coordinate in currently active sheet.
 
 getActiveSheet ()
 Get the currently active sheet.
 
 getAllBorders ()
 Get AllBorders (pseudo-border).
 
 getBottom ()
 Get Bottom.
 
 getDiagonal ()
 Get Diagonal.
 
 getDiagonalDirection ()
 Get DiagonalDirection.
 
 getHashCode ()
 Get hash code.
 
 getHorizontal ()
 Get Horizontal (pseudo-border).
 
 getInside ()
 Get Inside (pseudo-border).
 
 getIsSupervisor ()
 Is this a supervisor or a cell style component?
 
 getLeft ()
 Get Left.
 
 getOutline ()
 Get Outline (pseudo-border).
 
 getRight ()
 Get Right.
 
 getSelectedCells ()
 Get the currently active cell coordinate in currently active sheet.
 
 getSharedComponent ()
 Get the shared style component for the currently active cell in currently active sheet.
 
 getStyleArray (array $array)
 Build style array from subcomponents.
 
 getTop ()
 Get Top.
 
 getVertical ()
 Get Vertical (pseudo-border).
 
 setDiagonalDirection (int $direction)
 Set DiagonalDirection.
 

Public Attributes

const DIAGONAL_BOTH = 3
 
const DIAGONAL_DOWN = 2
 
const DIAGONAL_NONE = 0
 
const DIAGONAL_UP = 1
 

Protected Member Functions

 exportArray1 ()
 Abstract method to be implemented in anything which extends this class.
 
 exportArray2 (array &$exportedArray, string $index, mixed $objOrValue)
 Populate array from exportArray1.
 

Protected Attributes

Border $allBorders
 All borders pseudo-border.
 
Border $bottom
 Bottom.
 
Border $diagonal
 Diagonal.
 
int $diagonalDirection
 DiagonalDirection.
 
Border $horizontal
 Horizontal pseudo-border.
 
Border $inside
 Inside pseudo-border.
 
bool $isSupervisor
 
Border $left
 
Border $outline
 Outline pseudo-border.
 
Spreadsheet Supervisor $parent
 Parent.
 
string $parentPropertyName = null
 Parent property name.
 
Border $right
 Right.
 
Border $top
 Top.
 
Border $vertical
 Vertical pseudo-border.
 

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Style\Borders::__construct ( bool $isSupervisor = false,
bool $isConditional = false )

Create a new Borders.

Parameters
bool$isSupervisorFlag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are

Member Function Documentation

◆ __clone()

PhpOffice\PhpSpreadsheet\Style\Supervisor::__clone ( )
inherited

Implement PHP __clone to create a deep clone, not just a shallow copy.

Reimplemented in PhpOffice\PhpSpreadsheet\Style\Font.

◆ applyFromArray()

PhpOffice\PhpSpreadsheet\Style\Borders::applyFromArray ( array $styleArray)

Apply styles from array.

$spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( [ 'bottom' => [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ], 'top' => [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ] ] );

$spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray( [ 'allBorders' => [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ] ] );

Parameters
array$styleArrayArray containing style information
Return values
$this

◆ bindParent()

PhpOffice\PhpSpreadsheet\Style\Supervisor::bindParent ( Spreadsheet|self $parent,
?string $parentPropertyName = null )
inherited

Bind parent.

Only used for supervisor.

Return values
$this

◆ exportArray()

PhpOffice\PhpSpreadsheet\Style\Supervisor::exportArray ( )
finalinherited

Export style as array.

Available to anything which extends this class: Alignment, Border, Borders, Color, Fill, Font, NumberFormat, Protection, and Style.

◆ exportArray1()

PhpOffice\PhpSpreadsheet\Style\Borders::exportArray1 ( )
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.

◆ exportArray2()

PhpOffice\PhpSpreadsheet\Style\Supervisor::exportArray2 ( array & $exportedArray,
string $index,
mixed $objOrValue )
finalprotectedinherited

Populate array from exportArray1.

This method is available to anything which extends this class. The parameter index is the key to be added to the array. The parameter objOrValue is either a primitive type, which is the value added to the array, or a Style object to be recursively added via exportArray.

◆ getActiveCell()

PhpOffice\PhpSpreadsheet\Style\Supervisor::getActiveCell ( )
inherited

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Return values
stringE.g. 'A1'

◆ getActiveSheet()

PhpOffice\PhpSpreadsheet\Style\Supervisor::getActiveSheet ( )
inherited

Get the currently active sheet.

Only used for supervisor.

◆ getAllBorders()

PhpOffice\PhpSpreadsheet\Style\Borders::getAllBorders ( )

Get AllBorders (pseudo-border).

Only applies to supervisor.

◆ getHashCode()

PhpOffice\PhpSpreadsheet\Style\Borders::getHashCode ( )

Get hash code.

Return values
stringHash code

Implements PhpOffice\PhpSpreadsheet\IComparable.

◆ getHorizontal()

PhpOffice\PhpSpreadsheet\Style\Borders::getHorizontal ( )

Get Horizontal (pseudo-border).

Only applies to supervisor.

◆ getInside()

PhpOffice\PhpSpreadsheet\Style\Borders::getInside ( )

Get Inside (pseudo-border).

Only applies to supervisor.

◆ getOutline()

PhpOffice\PhpSpreadsheet\Style\Borders::getOutline ( )

Get Outline (pseudo-border).

Only applies to supervisor.

◆ getSelectedCells()

PhpOffice\PhpSpreadsheet\Style\Supervisor::getSelectedCells ( )
inherited

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Return values
stringE.g. 'A1'

◆ getSharedComponent()

PhpOffice\PhpSpreadsheet\Style\Borders::getSharedComponent ( )

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor.

Reimplemented from PhpOffice\PhpSpreadsheet\Style\Supervisor.

◆ getStyleArray()

PhpOffice\PhpSpreadsheet\Style\Borders::getStyleArray ( array $array)

Build style array from subcomponents.

Reimplemented from PhpOffice\PhpSpreadsheet\Style\Supervisor.

◆ getVertical()

PhpOffice\PhpSpreadsheet\Style\Borders::getVertical ( )

Get Vertical (pseudo-border).

Only applies to supervisor.

◆ setDiagonalDirection()

PhpOffice\PhpSpreadsheet\Style\Borders::setDiagonalDirection ( int $direction)

Set DiagonalDirection.

Parameters
int$directionsee self::DIAGONAL_*
Return values
$this

Member Data Documentation

◆ $allBorders

Border PhpOffice\PhpSpreadsheet\Style\Borders::$allBorders
protected

All borders pseudo-border.

Only applies to supervisor.

◆ $horizontal

Border PhpOffice\PhpSpreadsheet\Style\Borders::$horizontal
protected

Horizontal pseudo-border.

Only applies to supervisor.

◆ $inside

Border PhpOffice\PhpSpreadsheet\Style\Borders::$inside
protected

Inside pseudo-border.

Only applies to supervisor.

◆ $outline

Border PhpOffice\PhpSpreadsheet\Style\Borders::$outline
protected

Outline pseudo-border.

Only applies to supervisor.

◆ $parent

Spreadsheet Supervisor PhpOffice\PhpSpreadsheet\Style\Supervisor::$parent
protectedinherited

Parent.

Only used for supervisor.

◆ $vertical

Border PhpOffice\PhpSpreadsheet\Style\Borders::$vertical
protected

Vertical pseudo-border.

Only applies to supervisor.


The documentation for this class was generated from the following file: