Documentation

Border extends Supervisor
in package

Table of Contents

Constants

BORDER_DASHDOT  = 'dashDot'
BORDER_DASHDOTDOT  = 'dashDotDot'
BORDER_DASHED  = 'dashed'
BORDER_DOTTED  = 'dotted'
BORDER_DOUBLE  = 'double'
BORDER_HAIR  = 'hair'
BORDER_MEDIUM  = 'medium'
BORDER_MEDIUMDASHDOT  = 'mediumDashDot'
BORDER_MEDIUMDASHDOTDOT  = 'mediumDashDotDot'
BORDER_MEDIUMDASHED  = 'mediumDashed'
BORDER_NONE  = 'none'
BORDER_OMIT  = 'omit'
BORDER_SLANTDASHDOT  = 'slantDashDot'
BORDER_THICK  = 'thick'
BORDER_THIN  = 'thin'

Properties

$colorIndex  : int|null
$borderStyle  : string
Border style.
$color  : Color
Border color.
$isSupervisor  : bool
Supervisor?
$parent  : Spreadsheet|Supervisor
Parent. Only used for supervisor.
$parentPropertyName  : string|null
Parent property name.

Methods

__clone()  : mixed
Implement PHP __clone to create a deep clone, not just a shallow copy.
__construct()  : mixed
Create a new Border.
applyFromArray()  : $this
Apply styles from array.
bindParent()  : $this
Bind parent. Only used for supervisor.
exportArray()  : array<string|int, mixed>
Export style as array.
getActiveCell()  : string
Get the currently active cell coordinate in currently active sheet.
getActiveSheet()  : Worksheet
Get the currently active sheet. Only used for supervisor.
getBorderStyle()  : string
Get Border style.
getColor()  : Color
Get Border Color.
getHashCode()  : string
Get hash code.
getIsSupervisor()  : bool
Is this a supervisor or a cell style component?
getSelectedCells()  : string
Get the currently active cell coordinate in currently active sheet.
getSharedComponent()  : self
Get the shared style component for the currently active cell in currently active sheet.
getStyleArray()  : array<string|int, mixed>
Build style array from subcomponents.
setBorderStyle()  : $this
Set Border style.
setColor()  : $this
Set Border Color.
exportArray1()  : array<string|int, mixed>
Abstract method to be implemented in anything which extends this class.
exportArray2()  : void
Populate array from exportArray1.

Constants

BORDER_DASHDOT

public mixed BORDER_DASHDOT = 'dashDot'

BORDER_DASHDOTDOT

public mixed BORDER_DASHDOTDOT = 'dashDotDot'

BORDER_DASHED

public mixed BORDER_DASHED = 'dashed'

BORDER_DOTTED

public mixed BORDER_DOTTED = 'dotted'

BORDER_DOUBLE

public mixed BORDER_DOUBLE = 'double'

BORDER_HAIR

public mixed BORDER_HAIR = 'hair'

BORDER_MEDIUM

public mixed BORDER_MEDIUM = 'medium'

BORDER_MEDIUMDASHDOT

public mixed BORDER_MEDIUMDASHDOT = 'mediumDashDot'

BORDER_MEDIUMDASHDOTDOT

public mixed BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot'

BORDER_MEDIUMDASHED

public mixed BORDER_MEDIUMDASHED = 'mediumDashed'

BORDER_NONE

public mixed BORDER_NONE = 'none'

BORDER_OMIT

public mixed BORDER_OMIT = 'omit'

BORDER_SLANTDASHDOT

public mixed BORDER_SLANTDASHDOT = 'slantDashDot'

BORDER_THICK

public mixed BORDER_THICK = 'thick'

BORDER_THIN

public mixed BORDER_THIN = 'thin'

Properties

$colorIndex

public int|null $colorIndex = null

$borderStyle

Border style.

protected string $borderStyle = self::BORDER_NONE

$isSupervisor

Supervisor?

protected bool $isSupervisor

$parentPropertyName

Parent property name.

protected string|null $parentPropertyName = null

Methods

__clone()

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

public __clone() : mixed

__construct()

Create a new Border.

public __construct([bool $isSupervisor = false ][, bool $isConditional = false ]) : mixed
Parameters
$isSupervisor : bool = false

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

$isConditional : bool = false

applyFromArray()

Apply styles from array.

public applyFromArray(array<string|int, mixed> $styleArray) : $this
$spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray( [ 'borderStyle' => Border::BORDER_DASHDOT, 'color' => [ 'rgb' => '808080' ] ] );
Parameters
$styleArray : array<string|int, mixed>

Array containing style information

Return values
$this

bindParent()

Bind parent. Only used for supervisor.

public bindParent(Spreadsheet|self $parent[, string|null $parentPropertyName = null ]) : $this
Parameters
$parent : Spreadsheet|self
$parentPropertyName : string|null = null
Return values
$this

exportArray()

Export style as array.

public final exportArray() : array<string|int, mixed>

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

Return values
array<string|int, mixed>

getActiveCell()

Get the currently active cell coordinate in currently active sheet.

public getActiveCell() : string

Only used for supervisor.

Return values
string

E.g. 'A1'

getBorderStyle()

Get Border style.

public getBorderStyle() : string
Return values
string

getHashCode()

Get hash code.

public getHashCode() : string
Return values
string

Hash code

getIsSupervisor()

Is this a supervisor or a cell style component?

public getIsSupervisor() : bool
Return values
bool

getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

public getSelectedCells() : string

Only used for supervisor.

Return values
string

E.g. 'A1'

getSharedComponent()

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

public getSharedComponent() : self

Only used for style supervisor.

Return values
self

getStyleArray()

Build style array from subcomponents.

public getStyleArray(array<string|int, mixed> $array) : array<string|int, mixed>
Parameters
$array : array<string|int, mixed>
Return values
array<string|int, mixed>

setBorderStyle()

Set Border style.

public setBorderStyle(bool|string $style) : $this
Parameters
$style : bool|string

When passing a boolean, FALSE equates Border::BORDER_NONE and TRUE to Border::BORDER_MEDIUM

Return values
$this

setColor()

Set Border Color.

public setColor(Color $color) : $this
Parameters
$color : Color
Return values
$this

exportArray1()

Abstract method to be implemented in anything which extends this class.

protected exportArray1() : array<string|int, mixed>

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.

Return values
array<string|int, mixed>

exportArray2()

Populate array from exportArray1.

protected final exportArray2(array<string|int, mixed> &$exportedArray, string $index, mixed $objOrValue) : void

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.

Parameters
$exportedArray : array<string|int, mixed>
$index : string
$objOrValue : mixed

        
On this page

Search results