PHPExcel_Style

# Class: PHPExcel_Style

Source Location: /PHPExcel/Style.php

### Class Overview

PHPExcel_Style

#### Author(s):

#### Copyright:

- Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

Implements interfaces:

- PHPExcel_IComparable

### Methods

- __construct
- applyFromArray
- bindParent
- getActiveCell
- getActiveSheet
- getAlignment
- getBorders
- getConditionalStyles
- getFill
- getFont
- getHashCode
- getIndex
- getIsSupervisor
- getNumberFormat
- getParent
- getProtection
- getSelectedCells
- getSharedComponent
- setConditionalStyles
- setFont
- setIndex
- __clone

### Class Details

[line 36]
PHPExcel_Style

#### Tags:

copyright: | Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

[ Top ]

### Class Methods

### constructor __construct [line 118]

`PHPExcel_Style __construct( [boolean $isSupervisor = false], [boolean $isConditional = false])`

Create a new PHPExcel_Style

#### Tags:

access: | public

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

[ Top ]

### method applyFromArray [line 266]

`PHPExcel_Style applyFromArray( [array $pStyles = null], [boolean $pAdvanced = true])`

Apply styles from array

1. $objPHPExcel-> getActiveSheet ()->getStyle('B2')-> applyFromArray (
2. array(
3. 'font' => array(
4. 'name' => 'Arial',
5. 'bold' => true,
6. 'italic' => false,
7. 'underline' => PHPExcel_Style_Font ::UNDERLINE_DOUBLE,
8. 'strike' => false,
9. 'color' => array(
10. 'rgb' => '808080'
11. )
12. ),
13. 'borders' => array(
14. 'bottom' => array(
15. 'style' => PHPExcel_Style_Border ::BORDER_DASHDOT,
16. 'color' => array(
17. 'rgb' => '808080'
18. )
19. ),
20. 'top' => array(
21. 'style' => PHPExcel_Style_Border ::BORDER_DASHDOT,
22. 'color' => array(
23. 'rgb' => '808080'
24. )
25. )
26. )
27. )
28. );

#### Tags:

throws: | Exception
access: | public

#### Parameters:

array | $pStyles | Array containing style information
boolean | $pAdvanced | Advanced mode for setting borders.

[ Top ]

### method bindParent [line 149]

`PHPExcel_Style bindParent( PHPExcel $parent)`

Bind parent. Only used for supervisor

#### Tags:

access: | public

#### Parameters:

PHPExcel | $parent |

[ Top ]

### method getActiveCell [line 212]

`string getActiveCell( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getActiveSheet [line 190]

`PHPExcel_Worksheet getActiveSheet( )`

Get the currently active sheet. Only used for supervisor

#### Tags:

access: | public

[ Top ]

### method getAlignment [line 584]

`PHPExcel_Style_Alignment getAlignment( )`

Get Alignment

#### Tags:

access: | public

[ Top ]

### method getBorders [line 575]

`PHPExcel_Style_Borders getBorders( )`

Get Borders

#### Tags:

access: | public

[ Top ]

### method getConditionalStyles [line 602]

`PHPExcel_Style_Conditional[] getConditionalStyles( )`

Get Conditional Styles. Only used on supervisor.

#### Tags:

access: | public

[ Top ]

### method getFill [line 545]

`PHPExcel_Style_Fill getFill( )`

Get Fill

#### Tags:

access: | public

[ Top ]

### method getFont [line 554]

`PHPExcel_Style_Font getFont( )`

Get Font

#### Tags:

access: | public

[ Top ]

### method getHashCode [line 633]

`string getHashCode( )`

Get hash code

#### Tags:

return: | Hash code
access: | public

[ Top ]

### method getIndex [line 656]

`int getIndex( )`

Get own index in style collection

#### Tags:

access: | public

[ Top ]

### method getIsSupervisor [line 160]

`boolean getIsSupervisor( )`

Is this a supervisor or a real style component?

#### Tags:

access: | public

[ Top ]

### method getNumberFormat [line 593]

`PHPExcel_Style_NumberFormat getNumberFormat( )`

Get Number Format

#### Tags:

access: | public

[ Top ]

### method getParent [line 222]

`PHPExcel getParent( )`

Get parent. Only used for style supervisor

#### Tags:

access: | public

[ Top ]

### method getProtection [line 624]

`PHPExcel_Style_Protection getProtection( )`

Get Protection

#### Tags:

access: | public

[ Top ]

### method getSelectedCells [line 201]

`string getSelectedCells( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getSharedComponent [line 171]

`PHPExcel_Style getSharedComponent( )`

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

Only used for style supervisor

#### Tags:

access: | public

[ Top ]

### method setConditionalStyles [line 612]

`PHPExcel_Style setConditionalStyles( [PHPExcel_Style_Conditional[] $pValue = null])`

Set Conditional Styles. Only used on supervisor.

#### Tags:

access: | public

#### Parameters:

PHPExcel_Style_Conditional[] | $pValue | Array of condtional styles

[ Top ]

### method setFont [line 564]

`PHPExcel_Style setFont( PHPExcel_Style_Font $font)`

Set font

#### Tags:

access: | public

#### Parameters:

PHPExcel_Style_Font | $font |

[ Top ]

### method setIndex [line 666]

`void setIndex( int $pValue)`

Set own index in style collection

#### Tags:

access: | public

#### Parameters:

int | $pValue |

[ Top ]

### method __clone [line 674]

`void __clone( )`

Implement PHP __clone to create a deep clone, not just a shallow copy.

#### Tags:

access: | public

[ Top ]

Documentation generated on Fri, 12 Oct 2012 00:18:06 +0200 by phpDocumentor 1.4.4