ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Worksheet\SheetView Class Reference
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Worksheet\SheetView:

Public Member Functions

 __construct ()
 Create a new SheetView. More...
 
 getZoomScale ()
 Get ZoomScale. More...
 
 setZoomScale ($pValue)
 Set ZoomScale. More...
 
 getZoomScaleNormal ()
 Get ZoomScaleNormal. More...
 
 setZoomScaleNormal ($pValue)
 Set ZoomScale. More...
 
 setShowZeros ($pValue)
 Set ShowZeroes setting. More...
 
 getShowZeros ()
 
 getView ()
 Get View. More...
 
 setView ($pValue)
 Set View. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Data Fields

const SHEETVIEW_NORMAL = 'normal'
 
const SHEETVIEW_PAGE_LAYOUT = 'pageLayout'
 
const SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview'
 

Private Attributes

 $zoomScale = 100
 
 $zoomScaleNormal = 100
 
 $showZeros = true
 
 $sheetviewType = self::SHEETVIEW_NORMAL
 

Static Private Attributes

static $sheetViewTypes
 

Detailed Description

Definition at line 7 of file SheetView.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::__construct ( )

Create a new SheetView.

Definition at line 60 of file SheetView.php.

61  {
62  }

Member Function Documentation

◆ __clone()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::__clone ( )

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

Definition at line 182 of file SheetView.php.

References $key.

183  {
184  $vars = get_object_vars($this);
185  foreach ($vars as $key => $value) {
186  if (is_object($value)) {
187  $this->$key = clone $value;
188  } else {
189  $this->$key = $value;
190  }
191  }
192  }
$key
Definition: croninfo.php:18

◆ getShowZeros()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::getShowZeros ( )
Returns
bool

Definition at line 137 of file SheetView.php.

References PhpOffice\PhpSpreadsheet\Worksheet\SheetView\$showZeros.

◆ getView()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::getView ( )

Get View.

Returns
string

Definition at line 147 of file SheetView.php.

References PhpOffice\PhpSpreadsheet\Worksheet\SheetView\$sheetviewType.

◆ getZoomScale()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::getZoomScale ( )

Get ZoomScale.

Returns
int

Definition at line 69 of file SheetView.php.

References PhpOffice\PhpSpreadsheet\Worksheet\SheetView\$zoomScale.

◆ getZoomScaleNormal()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::getZoomScaleNormal ( )

Get ZoomScaleNormal.

Returns
int

Definition at line 100 of file SheetView.php.

References PhpOffice\PhpSpreadsheet\Worksheet\SheetView\$zoomScaleNormal.

◆ setShowZeros()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::setShowZeros (   $pValue)

Set ShowZeroes setting.

Parameters
bool$pValue

Definition at line 129 of file SheetView.php.

129  : void
130  {
131  $this->showZeros = $pValue;
132  }

◆ setView()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::setView (   $pValue)

Set View.

Valid values are 'normal' self::SHEETVIEW_NORMAL 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW

Parameters
string$pValue
Returns
$this

Definition at line 164 of file SheetView.php.

165  {
166  // MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
167  if ($pValue === null) {
168  $pValue = self::SHEETVIEW_NORMAL;
169  }
170  if (in_array($pValue, self::$sheetViewTypes)) {
171  $this->sheetviewType = $pValue;
172  } else {
173  throw new PhpSpreadsheetException('Invalid sheetview layout type.');
174  }
175 
176  return $this;
177  }

◆ setZoomScale()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::setZoomScale (   $pValue)

Set ZoomScale.

Valid values range from 10 to 400.

Parameters
int$pValue
Returns
$this

Definition at line 82 of file SheetView.php.

83  {
84  // Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
85  // but it is apparently still able to handle any scale >= 1
86  if (($pValue >= 1) || $pValue === null) {
87  $this->zoomScale = $pValue;
88  } else {
89  throw new PhpSpreadsheetException('Scale must be greater than or equal to 1.');
90  }
91 
92  return $this;
93  }

◆ setZoomScaleNormal()

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::setZoomScaleNormal (   $pValue)

Set ZoomScale.

Valid values range from 10 to 400.

Parameters
int$pValue
Returns
$this

Definition at line 113 of file SheetView.php.

114  {
115  if (($pValue >= 1) || $pValue === null) {
116  $this->zoomScaleNormal = $pValue;
117  } else {
118  throw new PhpSpreadsheetException('Scale must be greater than or equal to 1.');
119  }
120 
121  return $this;
122  }

Field Documentation

◆ $sheetviewType

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::$sheetviewType = self::SHEETVIEW_NORMAL
private

Definition at line 55 of file SheetView.php.

Referenced by PhpOffice\PhpSpreadsheet\Worksheet\SheetView\getView().

◆ $sheetViewTypes

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::$sheetViewTypes
staticprivate
Initial value:
= [
self::SHEETVIEW_NORMAL,
self::SHEETVIEW_PAGE_LAYOUT,
self::SHEETVIEW_PAGE_BREAK_PREVIEW,
]

Definition at line 14 of file SheetView.php.

◆ $showZeros

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::$showZeros = true
private

◆ $zoomScale

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::$zoomScale = 100
private

◆ $zoomScaleNormal

PhpOffice\PhpSpreadsheet\Worksheet\SheetView::$zoomScaleNormal = 100
private

◆ SHEETVIEW_NORMAL

const PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_NORMAL = 'normal'

Definition at line 10 of file SheetView.php.

Referenced by PhpOffice\PhpSpreadsheet\Reader\Xls\readWindow2().

◆ SHEETVIEW_PAGE_BREAK_PREVIEW

const PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW = 'pageBreakPreview'

Definition at line 12 of file SheetView.php.

Referenced by PhpOffice\PhpSpreadsheet\Reader\Xls\readWindow2().

◆ SHEETVIEW_PAGE_LAYOUT

const PhpOffice\PhpSpreadsheet\Worksheet\SheetView::SHEETVIEW_PAGE_LAYOUT = 'pageLayout'

The documentation for this class was generated from the following file: