class Border extends Supervisor (View source)

Constants

BORDER_NONE

BORDER_DASHDOT

BORDER_DASHDOTDOT

BORDER_DASHED

BORDER_DOTTED

BORDER_DOUBLE

BORDER_HAIR

BORDER_MEDIUM

BORDER_MEDIUMDASHDOT

BORDER_MEDIUMDASHDOTDOT

BORDER_MEDIUMDASHED

BORDER_SLANTDASHDOT

BORDER_THICK

BORDER_THIN

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 string $borderStyle Border style.
protected Color $color Border color.
int $colorIndex

Methods

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

Create a new Border.

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.

string
getBorderStyle()

Get Border style.

setBorderStyle(bool|string $pValue)

Set Border style.

getColor()

Get Border Color.

setColor(Color $pValue)

Set Border Color.

string
getHashCode()

Get hash code.

Details

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

Create a new Border.

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.

Border getSharedComponent()

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

Only used for style supervisor.

Return Value

Border

Exceptions

Exception

array getStyleArray(array $array)

Build style array from subcomponents.

Parameters

array $array

Return Value

array

Border applyFromArray(array $pStyles)

Apply styles from array.

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

Parameters

array $pStyles Array containing style information

Return Value

Border

Exceptions

Exception

string getBorderStyle()

Get Border style.

Return Value

string

Border setBorderStyle(bool|string $pValue)

Set Border style.

Parameters

bool|string $pValue When passing a boolean, FALSE equates Border::BORDER_NONE and TRUE to Border::BORDER_MEDIUM

Return Value

Border

Color getColor()

Get Border Color.

Return Value

Color

Border setColor(Color $pValue)

Set Border Color.

Parameters

Color $pValue

Return Value

Border

Exceptions

Exception

string getHashCode()

Get hash code.

Return Value

string Hash code