class Borders extends Supervisor (View source)

Constants

DIAGONAL_NONE

DIAGONAL_UP

DIAGONAL_DOWN

DIAGONAL_BOTH

Properties

protected bool $isSupervisor Supervisor? from Supervisor
protected Spreadsheet|Style $parent Parent. Only used for supervisor. from Supervisor
protected null|string $parentPropertyName Parent property name. from Supervisor
protected Border $left Left.
protected Border $right Right.
protected Border $top Top.
protected Border $bottom Bottom.
protected Border $diagonal Diagonal.
protected int $diagonalDirection DiagonalDirection.
protected Border $allBorders All borders pseudo-border. Only applies to supervisor.
protected Border $outline Outline pseudo-border. Only applies to supervisor.
protected Border $inside Inside pseudo-border. Only applies to supervisor.
protected Border $vertical Vertical pseudo-border. Only applies to supervisor.
protected Border $horizontal Horizontal pseudo-border. Only applies to supervisor.

Methods

__construct(bool $isSupervisor = false, bool $isConditional = false)

Create a new Borders.

bindParent(Spreadsheet|Style $parent, null|string $parentPropertyName = null)

Bind parent. Only used for supervisor.

bool
getIsSupervisor()

Is this a supervisor or a cell style component?

getActiveSheet()

Get the currently active sheet. Only used for supervisor.

string
getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

string
getActiveCell()

Get the currently active cell coordinate in currently active sheet.

__clone()

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

getSharedComponent()

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

array
getStyleArray(array $array)

Build style array from subcomponents.

applyFromArray(array $pStyles)

Apply styles from array.

getLeft()

Get Left.

getRight()

Get Right.

getTop()

Get Top.

getBottom()

Get Bottom.

getDiagonal()

Get Diagonal.

getAllBorders()

Get AllBorders (pseudo-border). Only applies to supervisor.

getOutline()

Get Outline (pseudo-border). Only applies to supervisor.

getInside()

Get Inside (pseudo-border). Only applies to supervisor.

getVertical()

Get Vertical (pseudo-border). Only applies to supervisor.

getHorizontal()

Get Horizontal (pseudo-border). Only applies to supervisor.

int
getDiagonalDirection()

Get DiagonalDirection.

setDiagonalDirection(int $pValue)

Set DiagonalDirection.

string
getHashCode()

Get hash code.

Details

__construct(bool $isSupervisor = false, bool $isConditional = false)

Create a new Borders.

Parameters

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

Supervisor bindParent(Spreadsheet|Style $parent, null|string $parentPropertyName = null)

Bind parent. Only used for supervisor.

Parameters

Spreadsheet|Style $parent
null|string $parentPropertyName

Return Value

Supervisor

bool getIsSupervisor()

Is this a supervisor or a cell style component?

Return Value

bool

Worksheet getActiveSheet()

Get the currently active sheet. Only used for supervisor.

Return Value

Worksheet

string getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Return Value

string E.g. 'A1'

string getActiveCell()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor.

Return Value

string E.g. 'A1'

__clone()

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

Borders getSharedComponent()

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

Only used for style supervisor.

Return Value

Borders

array getStyleArray(array $array)

Build style array from subcomponents.

Parameters

array $array

Return Value

array

Borders applyFromArray(array $pStyles)

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 $pStyles Array containing style information

Return Value

Borders

Exceptions

Exception

Border getLeft()

Get Left.

Return Value

Border

Border getRight()

Get Right.

Return Value

Border

Border getTop()

Get Top.

Return Value

Border

Border getBottom()

Get Bottom.

Return Value

Border

Border getDiagonal()

Get Diagonal.

Return Value

Border

Border getAllBorders()

Get AllBorders (pseudo-border). Only applies to supervisor.

Return Value

Border

Exceptions

Exception

Border getOutline()

Get Outline (pseudo-border). Only applies to supervisor.

Return Value

Border

Exceptions

Exception

Border getInside()

Get Inside (pseudo-border). Only applies to supervisor.

Return Value

Border

Exceptions

Exception

Border getVertical()

Get Vertical (pseudo-border). Only applies to supervisor.

Return Value

Border

Exceptions

Exception

Border getHorizontal()

Get Horizontal (pseudo-border). Only applies to supervisor.

Return Value

Border

Exceptions

Exception

int getDiagonalDirection()

Get DiagonalDirection.

Return Value

int

Borders setDiagonalDirection(int $pValue)

Set DiagonalDirection.

Parameters

int $pValue see self::DIAGONAL_*

Return Value

Borders

string getHashCode()

Get hash code.

Return Value

string Hash code