Documentation

Fill extends Supervisor
in package

Table of Contents

Constants

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'

Properties

$endcolorIndex  : int|null
$startcolorIndex  : int|null
$endColor  : Color
End color.
$fillType  : string|null
Fill type.
$isSupervisor  : bool
Supervisor?
$parent  : Spreadsheet|Supervisor
Parent. Only used for supervisor.
$parentPropertyName  : string|null
Parent property name.
$rotation  : float
Rotation.
$startColor  : Color
Start color.
$colorChanged  : bool

Methods

__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()  : string|null
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()  : self
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 int|null $endcolorIndex = null

$startcolorIndex

public int|null $startcolorIndex = null

$fillType

Fill type.

protected string|null $fillType = self::FILL_NONE

$isSupervisor

Supervisor?

protected bool $isSupervisor

$parentPropertyName

Parent property name.

protected string|null $parentPropertyName = null

$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

__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

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|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'

getColorsChanged()

public getColorsChanged() : bool
Return values
bool

getEndColor()

Get End Color.

public getEndColor() : Color
Return values
Color

getFillType()

Get Fill Type.

public getFillType() : string|null
Return values
string|null

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() : self

Only used for style supervisor.

Return values
self

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

        
On this page

Search results