class Fill extends Supervisor (View source)

Constants

FILL_NONE

FILL_SOLID

FILL_GRADIENT_LINEAR

FILL_GRADIENT_PATH

FILL_PATTERN_DARKDOWN

FILL_PATTERN_DARKGRAY

FILL_PATTERN_DARKGRID

FILL_PATTERN_DARKHORIZONTAL

FILL_PATTERN_DARKTRELLIS

FILL_PATTERN_DARKUP

FILL_PATTERN_DARKVERTICAL

FILL_PATTERN_GRAY0625

FILL_PATTERN_GRAY125

FILL_PATTERN_LIGHTDOWN

FILL_PATTERN_LIGHTGRAY

FILL_PATTERN_LIGHTGRID

FILL_PATTERN_LIGHTHORIZONTAL

FILL_PATTERN_LIGHTTRELLIS

FILL_PATTERN_LIGHTUP

FILL_PATTERN_LIGHTVERTICAL

FILL_PATTERN_MEDIUMGRAY

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
int $startcolorIndex
int $endcolorIndex
protected string $fillType Fill type.
protected float $rotation Rotation.
protected Color $startColor Start color.
protected Color $endColor End color.

Methods

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

Create a new Fill.

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
getFillType()

Get Fill Type.

setFillType(string $pValue)

Set Fill Type.

float
getRotation()

Get Rotation.

setRotation(float $pValue)

Set Rotation.

getStartColor()

Get Start Color.

setStartColor(Color $pValue)

Set Start Color.

getEndColor()

Get End Color.

setEndColor(Color $pValue)

Set End Color.

string
getHashCode()

Get hash code.

Details

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

Create a new Fill.

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.

Fill getSharedComponent()

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

Only used for style supervisor.

Return Value

Fill

array getStyleArray(array $array)

Build style array from subcomponents.

Parameters

array $array

Return Value

array

Fill applyFromArray(array $pStyles)

Apply styles from array.

$spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray( [ 'fillType' => Fill::FILL_GRADIENT_LINEAR, 'rotation' => 0, 'startColor' => [ 'rgb' => '000000' ], 'endColor' => [ 'argb' => 'FFFFFFFF' ] ] );

Parameters

array $pStyles Array containing style information

Return Value

Fill

Exceptions

Exception

string getFillType()

Get Fill Type.

Return Value

string

Fill setFillType(string $pValue)

Set Fill Type.

Parameters

string $pValue Fill type, see self::FILL_*

Return Value

Fill

float getRotation()

Get Rotation.

Return Value

float

Fill setRotation(float $pValue)

Set Rotation.

Parameters

float $pValue

Return Value

Fill

Color getStartColor()

Get Start Color.

Return Value

Color

Fill setStartColor(Color $pValue)

Set Start Color.

Parameters

Color $pValue

Return Value

Fill

Exceptions

Exception

Color getEndColor()

Get End Color.

Return Value

Color

Fill setEndColor(Color $pValue)

Set End Color.

Parameters

Color $pValue

Return Value

Fill

Exceptions

Exception

string getHashCode()

Get hash code.

Return Value

string Hash code