class PHPExcel_Style_Alignment extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable

PHPExcelStyleAlignment

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constants

HORIZONTAL_GENERAL

HORIZONTAL_LEFT

HORIZONTAL_RIGHT

HORIZONTAL_CENTER

HORIZONTAL_CENTER_CONTINUOUS

HORIZONTAL_JUSTIFY

HORIZONTAL_FILL

HORIZONTAL_DISTRIBUTED

VERTICAL_BOTTOM

VERTICAL_TOP

VERTICAL_CENTER

VERTICAL_JUSTIFY

VERTICAL_DISTRIBUTED

READORDER_CONTEXT

READORDER_LTR

READORDER_RTL

Methods

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

Create a new PHPExcelStyleAlignment

bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

boolean
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 = null)

Apply styles from array

string
getHorizontal()

Get Horizontal

setHorizontal(string $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)

Set Horizontal

string
getVertical()

Get Vertical

setVertical(string $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM)

Set Vertical

int
getTextRotation()

Get TextRotation

setTextRotation(int $pValue)

Set TextRotation

boolean
getWrapText()

Get Wrap Text

setWrapText(boolean $pValue = false)

Set Wrap Text

boolean
getShrinkToFit()

Get Shrink to fit

setShrinkToFit(boolean $pValue = false)

Set Shrink to fit

int
getIndent()

Get indent

setIndent(int $pValue)

Set indent

integer
getReadorder()

Get read order

setReadorder(int $pValue)

Set read order

string
getHashCode()

Get hash code

Details

at line 119
__construct(boolean $isSupervisor = false, boolean $isConditional = false)

Create a new PHPExcelStyleAlignment

Parameters

boolean $isSupervisor Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are
boolean $isConditional Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

PHPExcel_Style_Supervisor bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

Parameters

$parent
$parentPropertyName

Return Value

PHPExcel_Style_Supervisor

boolean getIsSupervisor()

Is this a supervisor or a cell style component?

Return Value

boolean

PHPExcel_Worksheet getActiveSheet()

Get the currently active sheet. Only used for supervisor

Return Value

PHPExcel_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.

at line 137
PHPExcel_Style_Alignment getSharedComponent()

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

Only used for style supervisor

at line 148
array getStyleArray(array $array)

Build style array from subcomponents

Parameters

array $array

Return Value

array

at line 171
PHPExcel_Style_Alignment applyFromArray(array $pStyles = null)

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray( array( 'horizontal' => PHPExcelStyleAlignment::HORIZONTALCENTER, 'vertical' => PHPExcelStyleAlignment::VERTICALCENTER, 'rotation' => 0, 'wrap' => TRUE ) );

Parameters

array $pStyles Array containing style information

Return Value

PHPExcel_Style_Alignment

Exceptions

PHPExcel_Exception

at line 211
string getHorizontal()

Get Horizontal

Return Value

string

at line 225
PHPExcel_Style_Alignment setHorizontal(string $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)

Set Horizontal

Parameters

string $pValue

Return Value

PHPExcel_Style_Alignment

at line 245
string getVertical()

Get Vertical

Return Value

string

at line 259
PHPExcel_Style_Alignment setVertical(string $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM)

Set Vertical

Parameters

string $pValue

Return Value

PHPExcel_Style_Alignment

at line 279
int getTextRotation()

Get TextRotation

Return Value

int

at line 294
PHPExcel_Style_Alignment setTextRotation(int $pValue)

Set TextRotation

Parameters

int $pValue

Return Value

PHPExcel_Style_Alignment

Exceptions

PHPExcel_Exception

at line 321
boolean getWrapText()

Get Wrap Text

Return Value

boolean

at line 335
PHPExcel_Style_Alignment setWrapText(boolean $pValue = false)

Set Wrap Text

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Alignment

at line 354
boolean getShrinkToFit()

Get Shrink to fit

Return Value

boolean

at line 368
PHPExcel_Style_Alignment setShrinkToFit(boolean $pValue = false)

Set Shrink to fit

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Alignment

at line 387
int getIndent()

Get indent

Return Value

int

at line 401
PHPExcel_Style_Alignment setIndent(int $pValue)

Set indent

Parameters

int $pValue

Return Value

PHPExcel_Style_Alignment

at line 424
integer getReadorder()

Get read order

Return Value

integer

at line 438
PHPExcel_Style_Alignment setReadorder(int $pValue)

Set read order

Parameters

int $pValue

Return Value

PHPExcel_Style_Alignment

at line 457
string getHashCode()

Get hash code

Return Value

string Hash code