Protection
Table of Contents
- ALGORITHM_MD2 = 'MD2'
- ALGORITHM_MD4 = 'MD4'
- ALGORITHM_MD5 = 'MD5'
- ALGORITHM_RIPEMD_128 = 'RIPEMD-128'
- ALGORITHM_RIPEMD_160 = 'RIPEMD-160'
- ALGORITHM_SHA_1 = 'SHA-1'
- ALGORITHM_SHA_256 = 'SHA-256'
- ALGORITHM_SHA_384 = 'SHA-384'
- ALGORITHM_SHA_512 = 'SHA-512'
- ALGORITHM_WHIRLPOOL = 'WHIRLPOOL'
- $algorithm : string
- Algorithm name.
- $autoFilter : bool|null
- Autofilters are locked when sheet is protected, default true.
- $deleteColumns : bool|null
- Deleting columns is locked when sheet is protected, default true.
- $deleteRows : bool|null
- Deleting rows is locked when sheet is protected, default true.
- $formatCells : bool|null
- Formatting cells is locked when sheet is protected, default true.
- $formatColumns : bool|null
- Formatting columns is locked when sheet is protected, default true.
- $formatRows : bool|null
- Formatting rows is locked when sheet is protected, default true.
- $insertColumns : bool|null
- Inserting columns is locked when sheet is protected, default true.
- $insertHyperlinks : bool|null
- Inserting hyperlinks is locked when sheet is protected, default true.
- $insertRows : bool|null
- Inserting rows is locked when sheet is protected, default true.
- $objects : bool|null
- Objects are locked when sheet is protected, default false.
- $password : string
- Hashed password.
- $pivotTables : bool|null
- Pivot tables are locked when the sheet is protected, default true.
- $salt : string
- Salt value.
- $scenarios : bool|null
- Scenarios are locked when sheet is protected, default false.
- $selectLockedCells : bool|null
- Selection of locked cells is locked when sheet is protected, default false.
- $selectUnlockedCells : bool|null
- Selection of unlocked cells is locked when sheet is protected, default false.
- $sheet : bool|null
- Sheet is locked when sheet is protected, default false.
- $sort : bool|null
- Sorting is locked when sheet is protected, default true.
- $spinCount : int
- Spin count.
- __clone() : mixed
- Implement PHP __clone to create a deep clone, not just a shallow copy.
- __construct() : mixed
- Create a new Protection.
- getAlgorithm() : string
- Get algorithm name.
- getAutoFilter() : bool|null
- getDeleteColumns() : bool|null
- getDeleteRows() : bool|null
- getFormatCells() : bool|null
- getFormatColumns() : bool|null
- getFormatRows() : bool|null
- getInsertColumns() : bool|null
- getInsertHyperlinks() : bool|null
- getInsertRows() : bool|null
- getObjects() : bool|null
- getPassword() : string
- Get hashed password.
- getPivotTables() : bool|null
- getSalt() : string
- getScenarios() : bool|null
- getSelectLockedCells() : bool|null
- getSelectUnlockedCells() : bool|null
- getSheet() : bool|null
- getSort() : bool|null
- getSpinCount() : int
- Get spin count.
- isProtectionEnabled() : bool
- Is some sort of protection enabled?
- setAlgorithm() : self
- Set algorithm name.
- setAlgorithmName() : self
- Set algorithm name.
- setAutoFilter() : self
- setDeleteColumns() : self
- setDeleteRows() : self
- setFormatCells() : self
- setFormatColumns() : self
- setFormatRows() : self
- setHashValue() : self
- setInsertColumns() : self
- setInsertHyperlinks() : self
- setInsertRows() : self
- setObjects() : self
- setPassword() : $this
- Set Password.
- setPivotTables() : self
- setSalt() : self
- setSaltValue() : self
- setScenarios() : self
- setSelectLockedCells() : self
- setSelectUnlockedCells() : self
- setSheet() : self
- setSort() : self
- setSpinCount() : self
- Set spin count.
- verify() : bool
- Verify that the given non-hashed password can "unlock" the protection.
- generateSalt() : string
- Create a pseudorandom string.
Constants
ALGORITHM_MD2
public
mixed
ALGORITHM_MD2
= 'MD2'
ALGORITHM_MD4
public
mixed
ALGORITHM_MD4
= 'MD4'
ALGORITHM_MD5
public
mixed
ALGORITHM_MD5
= 'MD5'
ALGORITHM_RIPEMD_128
public
mixed
ALGORITHM_RIPEMD_128
= 'RIPEMD-128'
ALGORITHM_RIPEMD_160
public
mixed
ALGORITHM_RIPEMD_160
= 'RIPEMD-160'
ALGORITHM_SHA_1
public
mixed
ALGORITHM_SHA_1
= 'SHA-1'
ALGORITHM_SHA_256
public
mixed
ALGORITHM_SHA_256
= 'SHA-256'
ALGORITHM_SHA_384
public
mixed
ALGORITHM_SHA_384
= 'SHA-384'
ALGORITHM_SHA_512
public
mixed
ALGORITHM_SHA_512
= 'SHA-512'
ALGORITHM_WHIRLPOOL
public
mixed
ALGORITHM_WHIRLPOOL
= 'WHIRLPOOL'
Properties
$algorithm
Algorithm name.
private
string
$algorithm
= ''
$autoFilter
Autofilters are locked when sheet is protected, default true.
private
bool|null
$autoFilter
$deleteColumns
Deleting columns is locked when sheet is protected, default true.
private
bool|null
$deleteColumns
$deleteRows
Deleting rows is locked when sheet is protected, default true.
private
bool|null
$deleteRows
$formatCells
Formatting cells is locked when sheet is protected, default true.
private
bool|null
$formatCells
$formatColumns
Formatting columns is locked when sheet is protected, default true.
private
bool|null
$formatColumns
$formatRows
Formatting rows is locked when sheet is protected, default true.
private
bool|null
$formatRows
$insertColumns
Inserting columns is locked when sheet is protected, default true.
private
bool|null
$insertColumns
$insertHyperlinks
Inserting hyperlinks is locked when sheet is protected, default true.
private
bool|null
$insertHyperlinks
$insertRows
Inserting rows is locked when sheet is protected, default true.
private
bool|null
$insertRows
$objects
Objects are locked when sheet is protected, default false.
private
bool|null
$objects
$password
Hashed password.
private
string
$password
= ''
$pivotTables
Pivot tables are locked when the sheet is protected, default true.
private
bool|null
$pivotTables
$salt
Salt value.
private
string
$salt
= ''
$scenarios
Scenarios are locked when sheet is protected, default false.
private
bool|null
$scenarios
$selectLockedCells
Selection of locked cells is locked when sheet is protected, default false.
private
bool|null
$selectLockedCells
$selectUnlockedCells
Selection of unlocked cells is locked when sheet is protected, default false.
private
bool|null
$selectUnlockedCells
$sheet
Sheet is locked when sheet is protected, default false.
private
bool|null
$sheet
$sort
Sorting is locked when sheet is protected, default true.
private
bool|null
$sort
$spinCount
Spin count.
private
int
$spinCount
= 10000
Methods
__clone()
Implement PHP __clone to create a deep clone, not just a shallow copy.
public
__clone() : mixed
Return values
mixed —__construct()
Create a new Protection.
public
__construct() : mixed
Return values
mixed —getAlgorithm()
Get algorithm name.
public
getAlgorithm() : string
Return values
string —getAutoFilter()
public
getAutoFilter() : bool|null
Return values
bool|null —getDeleteColumns()
public
getDeleteColumns() : bool|null
Return values
bool|null —getDeleteRows()
public
getDeleteRows() : bool|null
Return values
bool|null —getFormatCells()
public
getFormatCells() : bool|null
Return values
bool|null —getFormatColumns()
public
getFormatColumns() : bool|null
Return values
bool|null —getFormatRows()
public
getFormatRows() : bool|null
Return values
bool|null —getInsertColumns()
public
getInsertColumns() : bool|null
Return values
bool|null —getInsertHyperlinks()
public
getInsertHyperlinks() : bool|null
Return values
bool|null —getInsertRows()
public
getInsertRows() : bool|null
Return values
bool|null —getObjects()
public
getObjects() : bool|null
Return values
bool|null —getPassword()
Get hashed password.
public
getPassword() : string
Return values
string —getPivotTables()
public
getPivotTables() : bool|null
Return values
bool|null —getSalt()
public
getSalt() : string
Return values
string —getScenarios()
public
getScenarios() : bool|null
Return values
bool|null —getSelectLockedCells()
public
getSelectLockedCells() : bool|null
Return values
bool|null —getSelectUnlockedCells()
public
getSelectUnlockedCells() : bool|null
Return values
bool|null —getSheet()
public
getSheet() : bool|null
Return values
bool|null —getSort()
public
getSort() : bool|null
Return values
bool|null —getSpinCount()
Get spin count.
public
getSpinCount() : int
Return values
int —isProtectionEnabled()
Is some sort of protection enabled?
public
isProtectionEnabled() : bool
Return values
bool —setAlgorithm()
Set algorithm name.
public
setAlgorithm(string $algorithm) : self
Parameters
- $algorithm : string
Return values
self —setAlgorithmName()
Set algorithm name.
public
setAlgorithmName(string $algorithm) : self
Parameters
- $algorithm : string
Return values
self —setAutoFilter()
public
setAutoFilter(bool|null $autoFilter) : self
Parameters
- $autoFilter : bool|null
Return values
self —setDeleteColumns()
public
setDeleteColumns(bool|null $deleteColumns) : self
Parameters
- $deleteColumns : bool|null
Return values
self —setDeleteRows()
public
setDeleteRows(bool|null $deleteRows) : self
Parameters
- $deleteRows : bool|null
Return values
self —setFormatCells()
public
setFormatCells(bool|null $formatCells) : self
Parameters
- $formatCells : bool|null
Return values
self —setFormatColumns()
public
setFormatColumns(bool|null $formatColumns) : self
Parameters
- $formatColumns : bool|null
Return values
self —setFormatRows()
public
setFormatRows(bool|null $formatRows) : self
Parameters
- $formatRows : bool|null
Return values
self —setHashValue()
public
setHashValue(string $password) : self
Parameters
- $password : string
Return values
self —setInsertColumns()
public
setInsertColumns(bool|null $insertColumns) : self
Parameters
- $insertColumns : bool|null
Return values
self —setInsertHyperlinks()
public
setInsertHyperlinks(bool|null $insertHyperLinks) : self
Parameters
- $insertHyperLinks : bool|null
Return values
self —setInsertRows()
public
setInsertRows(bool|null $insertRows) : self
Parameters
- $insertRows : bool|null
Return values
self —setObjects()
public
setObjects(bool|null $objects) : self
Parameters
- $objects : bool|null
Return values
self —setPassword()
Set Password.
public
setPassword(string $password[, bool $alreadyHashed = false ]) : $this
Parameters
- $password : string
- $alreadyHashed : bool = false
-
If the password has already been hashed, set this to true
Return values
$this —setPivotTables()
public
setPivotTables(bool|null $pivotTables) : self
Parameters
- $pivotTables : bool|null
Return values
self —setSalt()
public
setSalt(string $salt) : self
Parameters
- $salt : string
Return values
self —setSaltValue()
public
setSaltValue(string $salt) : self
Parameters
- $salt : string
Return values
self —setScenarios()
public
setScenarios(bool|null $scenarios) : self
Parameters
- $scenarios : bool|null
Return values
self —setSelectLockedCells()
public
setSelectLockedCells(bool|null $selectLockedCells) : self
Parameters
- $selectLockedCells : bool|null
Return values
self —setSelectUnlockedCells()
public
setSelectUnlockedCells(bool|null $selectUnlockedCells) : self
Parameters
- $selectUnlockedCells : bool|null
Return values
self —setSheet()
public
setSheet(bool|null $sheet) : self
Parameters
- $sheet : bool|null
Return values
self —setSort()
public
setSort(bool|null $sort) : self
Parameters
- $sort : bool|null
Return values
self —setSpinCount()
Set spin count.
public
setSpinCount(int $spinCount) : self
Parameters
- $spinCount : int
Return values
self —verify()
Verify that the given non-hashed password can "unlock" the protection.
public
verify(string $password) : bool
Parameters
- $password : string
Return values
bool —generateSalt()
Create a pseudorandom string.
private
generateSalt() : string