Borders extends Supervisor
Table of Contents
- DIAGONAL_BOTH = 3
- DIAGONAL_DOWN = 2
- DIAGONAL_NONE = 0
- DIAGONAL_UP = 1
- $allBorders : Border
- All borders pseudo-border. Only applies to supervisor.
- $bottom : Border
- Bottom.
- $diagonal : Border
- Diagonal.
- $diagonalDirection : int
- DiagonalDirection.
- $horizontal : Border
- Horizontal pseudo-border. Only applies to supervisor.
- $inside : Border
- Inside pseudo-border. Only applies to supervisor.
- $isSupervisor : bool
- Supervisor?
- $left : Border
- Left.
- $outline : Border
- Outline pseudo-border. Only applies to supervisor.
- $parent : Spreadsheet|Supervisor
- Parent. Only used for supervisor.
- $parentPropertyName : null|string
- Parent property name.
- $right : Border
- Right.
- $top : Border
- Top.
- $vertical : Border
- Vertical pseudo-border. Only applies to supervisor.
- __clone() : mixed
- Implement PHP __clone to create a deep clone, not just a shallow copy.
- __construct() : mixed
- Create a new Borders.
- 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.
- getAllBorders() : Border
- Get AllBorders (pseudo-border). Only applies to supervisor.
- getBottom() : Border
- Get Bottom.
- getDiagonal() : Border
- Get Diagonal.
- getDiagonalDirection() : int
- Get DiagonalDirection.
- getHashCode() : string
- Get hash code.
- getHorizontal() : Border
- Get Horizontal (pseudo-border). Only applies to supervisor.
- getInside() : Border
- Get Inside (pseudo-border). Only applies to supervisor.
- getIsSupervisor() : bool
- Is this a supervisor or a cell style component?
- getLeft() : Border
- Get Left.
- getOutline() : Border
- Get Outline (pseudo-border). Only applies to supervisor.
- getRight() : Border
- Get Right.
- getSelectedCells() : string
- Get the currently active cell coordinate in currently active sheet.
- getSharedComponent() : Borders
- Get the shared style component for the currently active cell in currently active sheet.
- getStyleArray() : array<string|int, mixed>
- Build style array from subcomponents.
- getTop() : Border
- Get Top.
- getVertical() : Border
- Get Vertical (pseudo-border). Only applies to supervisor.
- setDiagonalDirection() : $this
- Set DiagonalDirection.
- exportArray1() : array<string|int, mixed>
- Abstract method to be implemented in anything which extends this class.
- exportArray2() : void
- Populate array from exportArray1.
Constants
DIAGONAL_BOTH
public
mixed
DIAGONAL_BOTH
= 3
DIAGONAL_DOWN
public
mixed
DIAGONAL_DOWN
= 2
DIAGONAL_NONE
public
mixed
DIAGONAL_NONE
= ""
DIAGONAL_UP
public
mixed
DIAGONAL_UP
= 1
Properties
$allBorders
All borders pseudo-border. Only applies to supervisor.
protected
Border
$allBorders
$bottom
Bottom.
protected
Border
$bottom
$diagonal
Diagonal.
protected
Border
$diagonal
$diagonalDirection
DiagonalDirection.
protected
int
$diagonalDirection
$horizontal
Horizontal pseudo-border. Only applies to supervisor.
protected
Border
$horizontal
$inside
Inside pseudo-border. Only applies to supervisor.
protected
Border
$inside
$isSupervisor
Supervisor?
protected
bool
$isSupervisor
$left
Left.
protected
Border
$left
$outline
Outline pseudo-border. Only applies to supervisor.
protected
Border
$outline
$parent
Parent. Only used for supervisor.
protected
Spreadsheet|Supervisor
$parent
$parentPropertyName
Parent property name.
protected
null|string
$parentPropertyName
$right
Right.
protected
Border
$right
$top
Top.
protected
Border
$top
$vertical
Vertical pseudo-border. Only applies to supervisor.
protected
Border
$vertical
Methods
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
public
__clone() : mixed
Return values
mixed —__construct()
Create a new Borders.
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
Return values
mixed —applyFromArray()
Apply styles from array.
public
applyFromArray(array<string|int, mixed> $styleArray) : $this
$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
- $styleArray : array<string|int, mixed>
-
Array containing style information
Return values
$this —bindParent()
Bind parent. Only used for supervisor.
public
bindParent(Spreadsheet|Supervisor $parent[, null|string $parentPropertyName = null ]) : $this
Parameters
- $parent : Spreadsheet|Supervisor
- $parentPropertyName : null|string = 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'
getActiveSheet()
Get the currently active sheet. Only used for supervisor.
public
getActiveSheet() : Worksheet
Return values
Worksheet —getAllBorders()
Get AllBorders (pseudo-border). Only applies to supervisor.
public
getAllBorders() : Border
Return values
Border —getBottom()
Get Bottom.
public
getBottom() : Border
Return values
Border —getDiagonal()
Get Diagonal.
public
getDiagonal() : Border
Return values
Border —getDiagonalDirection()
Get DiagonalDirection.
public
getDiagonalDirection() : int
Return values
int —getHashCode()
Get hash code.
public
getHashCode() : string
Return values
string —Hash code
getHorizontal()
Get Horizontal (pseudo-border). Only applies to supervisor.
public
getHorizontal() : Border
Return values
Border —getInside()
Get Inside (pseudo-border). Only applies to supervisor.
public
getInside() : Border
Return values
Border —getIsSupervisor()
Is this a supervisor or a cell style component?
public
getIsSupervisor() : bool
Return values
bool —getLeft()
Get Left.
public
getLeft() : Border
Return values
Border —getOutline()
Get Outline (pseudo-border). Only applies to supervisor.
public
getOutline() : Border
Return values
Border —getRight()
Get Right.
public
getRight() : Border
Return values
Border —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() : Borders
Only used for style supervisor.
Return values
Borders —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> —getTop()
Get Top.
public
getTop() : Border
Return values
Border —getVertical()
Get Vertical (pseudo-border). Only applies to supervisor.
public
getVertical() : Border
Return values
Border —setDiagonalDirection()
Set DiagonalDirection.
public
setDiagonalDirection(int $direction) : $this
Parameters
- $direction : int
-
see self::DIAGONAL_*
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