Fill extends Supervisor
Table of Contents
- FILL_GRADIENT_LINEAR = 'linear'
- FILL_GRADIENT_PATH = 'path'
- FILL_NONE = 'none'
- FILL_PATTERN_DARKDOWN = 'darkDown'
- FILL_PATTERN_DARKGRAY = 'darkGray'
- FILL_PATTERN_DARKGRID = 'darkGrid'
- FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal'
- FILL_PATTERN_DARKTRELLIS = 'darkTrellis'
- FILL_PATTERN_DARKUP = 'darkUp'
- FILL_PATTERN_DARKVERTICAL = 'darkVertical'
- FILL_PATTERN_GRAY0625 = 'gray0625'
- FILL_PATTERN_GRAY125 = 'gray125'
- FILL_PATTERN_LIGHTDOWN = 'lightDown'
- FILL_PATTERN_LIGHTGRAY = 'lightGray'
- FILL_PATTERN_LIGHTGRID = 'lightGrid'
- FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal'
- FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis'
- FILL_PATTERN_LIGHTUP = 'lightUp'
- FILL_PATTERN_LIGHTVERTICAL = 'lightVertical'
- FILL_PATTERN_MEDIUMGRAY = 'mediumGray'
- FILL_SOLID = 'solid'
- $endcolorIndex : null|int
- $startcolorIndex : null|int
- $endColor : Color
- End color.
- $fillType : null|string
- Fill type.
- $isSupervisor : bool
- Supervisor?
- $parent : Spreadsheet|Supervisor
- Parent. Only used for supervisor.
- $parentPropertyName : null|string
- Parent property name.
- $rotation : float
- Rotation.
- $startColor : Color
- Start color.
- $colorChanged : bool
- __clone() : mixed
- Implement PHP __clone to create a deep clone, not just a shallow copy.
- __construct() : mixed
- Create a new Fill.
- 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.
- getColorsChanged() : bool
- getEndColor() : Color
- Get End Color.
- getFillType() : null|string
- Get Fill Type.
- getHashCode() : string
- Get hash code.
- getIsSupervisor() : bool
- Is this a supervisor or a cell style component?
- getRotation() : float
- Get Rotation.
- getSelectedCells() : string
- Get the currently active cell coordinate in currently active sheet.
- getSharedComponent() : Fill
- Get the shared style component for the currently active cell in currently active sheet.
- getStartColor() : Color
- Get Start Color.
- getStyleArray() : array<string|int, mixed>
- Build style array from subcomponents.
- setEndColor() : $this
- Set End Color.
- setFillType() : $this
- Set Fill Type.
- setRotation() : $this
- Set Rotation.
- setStartColor() : $this
- Set Start Color.
- exportArray1() : array<string|int, mixed>
- Abstract method to be implemented in anything which extends this class.
- exportArray2() : void
- Populate array from exportArray1.
Constants
FILL_GRADIENT_LINEAR
public
mixed
FILL_GRADIENT_LINEAR
= 'linear'
FILL_GRADIENT_PATH
public
mixed
FILL_GRADIENT_PATH
= 'path'
FILL_NONE
public
mixed
FILL_NONE
= 'none'
FILL_PATTERN_DARKDOWN
public
mixed
FILL_PATTERN_DARKDOWN
= 'darkDown'
FILL_PATTERN_DARKGRAY
public
mixed
FILL_PATTERN_DARKGRAY
= 'darkGray'
FILL_PATTERN_DARKGRID
public
mixed
FILL_PATTERN_DARKGRID
= 'darkGrid'
FILL_PATTERN_DARKHORIZONTAL
public
mixed
FILL_PATTERN_DARKHORIZONTAL
= 'darkHorizontal'
FILL_PATTERN_DARKTRELLIS
public
mixed
FILL_PATTERN_DARKTRELLIS
= 'darkTrellis'
FILL_PATTERN_DARKUP
public
mixed
FILL_PATTERN_DARKUP
= 'darkUp'
FILL_PATTERN_DARKVERTICAL
public
mixed
FILL_PATTERN_DARKVERTICAL
= 'darkVertical'
FILL_PATTERN_GRAY0625
public
mixed
FILL_PATTERN_GRAY0625
= 'gray0625'
FILL_PATTERN_GRAY125
public
mixed
FILL_PATTERN_GRAY125
= 'gray125'
FILL_PATTERN_LIGHTDOWN
public
mixed
FILL_PATTERN_LIGHTDOWN
= 'lightDown'
FILL_PATTERN_LIGHTGRAY
public
mixed
FILL_PATTERN_LIGHTGRAY
= 'lightGray'
FILL_PATTERN_LIGHTGRID
public
mixed
FILL_PATTERN_LIGHTGRID
= 'lightGrid'
FILL_PATTERN_LIGHTHORIZONTAL
public
mixed
FILL_PATTERN_LIGHTHORIZONTAL
= 'lightHorizontal'
FILL_PATTERN_LIGHTTRELLIS
public
mixed
FILL_PATTERN_LIGHTTRELLIS
= 'lightTrellis'
FILL_PATTERN_LIGHTUP
public
mixed
FILL_PATTERN_LIGHTUP
= 'lightUp'
FILL_PATTERN_LIGHTVERTICAL
public
mixed
FILL_PATTERN_LIGHTVERTICAL
= 'lightVertical'
FILL_PATTERN_MEDIUMGRAY
public
mixed
FILL_PATTERN_MEDIUMGRAY
= 'mediumGray'
FILL_SOLID
public
mixed
FILL_SOLID
= 'solid'
Properties
$endcolorIndex
public
null|int
$endcolorIndex
$startcolorIndex
public
null|int
$startcolorIndex
$endColor
End color.
protected
Color
$endColor
$fillType
Fill type.
protected
null|string
$fillType
= self::FILL_NONE
$isSupervisor
Supervisor?
protected
bool
$isSupervisor
$parent
Parent. Only used for supervisor.
protected
Spreadsheet|Supervisor
$parent
$parentPropertyName
Parent property name.
protected
null|string
$parentPropertyName
$rotation
Rotation.
protected
float
$rotation
= 0.0
$startColor
Start color.
protected
Color
$startColor
$colorChanged
private
bool
$colorChanged
= false
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 Fill.
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
-
Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are
Return values
mixed —applyFromArray()
Apply styles from array.
public
applyFromArray(array<string|int, mixed> $styleArray) : $this
$spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
[
'fillType' => Fill::FILL_GRADIENT_LINEAR,
'rotation' => 0.0,
'startColor' => [
'rgb' => '000000'
],
'endColor' => [
'argb' => 'FFFFFFFF'
]
]
);
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 —getColorsChanged()
public
getColorsChanged() : bool
Return values
bool —getEndColor()
Get End Color.
public
getEndColor() : Color
Return values
Color —getFillType()
Get Fill Type.
public
getFillType() : null|string
Return values
null|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 —getRotation()
Get Rotation.
public
getRotation() : float
Return values
float —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() : Fill
Only used for style supervisor.
Return values
Fill —getStartColor()
Get Start Color.
public
getStartColor() : Color
Return values
Color —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> —setEndColor()
Set End Color.
public
setEndColor(Color $color) : $this
Parameters
- $color : Color
Return values
$this —setFillType()
Set Fill Type.
public
setFillType(string $fillType) : $this
Parameters
- $fillType : string
-
Fill type, see self::FILL_*
Return values
$this —setRotation()
Set Rotation.
public
setRotation(float $angleInDegrees) : $this
Parameters
- $angleInDegrees : float
Return values
$this —setStartColor()
Set Start Color.
public
setStartColor(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