init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
55
lib/PhpSpreadsheet/Worksheet/PageBreak.php
Normal file
55
lib/PhpSpreadsheet/Worksheet/PageBreak.php
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Worksheet;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Calculation\Functions;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\CellAddress;
|
||||
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
|
||||
|
||||
class PageBreak
|
||||
{
|
||||
private int $breakType;
|
||||
|
||||
private string $coordinate;
|
||||
|
||||
private int $maxColOrRow;
|
||||
|
||||
/** @param array|CellAddress|string $coordinate */
|
||||
public function __construct(int $breakType, $coordinate, int $maxColOrRow = -1)
|
||||
{
|
||||
$coordinate = Functions::trimSheetFromCellReference(Validations::validateCellAddress($coordinate));
|
||||
$this->breakType = $breakType;
|
||||
$this->coordinate = $coordinate;
|
||||
$this->maxColOrRow = $maxColOrRow;
|
||||
}
|
||||
|
||||
public function getBreakType(): int
|
||||
{
|
||||
return $this->breakType;
|
||||
}
|
||||
|
||||
public function getCoordinate(): string
|
||||
{
|
||||
return $this->coordinate;
|
||||
}
|
||||
|
||||
public function getMaxColOrRow(): int
|
||||
{
|
||||
return $this->maxColOrRow;
|
||||
}
|
||||
|
||||
public function getColumnInt(): int
|
||||
{
|
||||
return Coordinate::indexesFromString($this->coordinate)[0];
|
||||
}
|
||||
|
||||
public function getRow(): int
|
||||
{
|
||||
return Coordinate::indexesFromString($this->coordinate)[1];
|
||||
}
|
||||
|
||||
public function getColumnString(): string
|
||||
{
|
||||
return Coordinate::indexesFromString($this->coordinate)[2];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue