\PhpOffice\PhpWord\MetadataProtection

Document protection class

Summary

Methods
Properties
Constants
__construct()
getEditing()
setEditing()
getPassword()
setPassword()
getSpinCount()
setSpinCount()
getAlgorithm()
setAlgorithm()
getSalt()
setSalt()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$editing
$password
$spinCount
$algorithm
$salt
N/A

Properties

$editing

$editing : string

Editing restriction none|readOnly|comments|trackedChanges|forms

Type

string

$password

$password : string

password

Type

string

$spinCount

$spinCount : integer

Iterations to Run Hashing Algorithm

Type

integer

$algorithm

$algorithm : string

Cryptographic Hashing Algorithm (see constants defined in \PhpOffice\PhpWord\Shared\Microsoft\PasswordEncoder)

Type

string

$salt

$salt : string

Salt for Password Verifier

Type

string

Methods

__construct()

__construct(string  $editing = null) 

Create a new instance

Parameters

string $editing

getEditing()

getEditing() : string

Get editing protection

Returns

string

setEditing()

setEditing(string  $editing = null) : self

Set editing protection

Parameters

string $editing

Any value of \PhpOffice\PhpWord\SimpleType\DocProtect

Returns

self

getPassword()

getPassword() : string

Get password

Returns

string

setPassword()

setPassword(string  $password) : self

Set password

Parameters

string $password

Returns

self

getSpinCount()

getSpinCount() : integer

Get count for hash iterations

Returns

integer

setSpinCount()

setSpinCount(integer  $spinCount) : self

Set count for hash iterations

Parameters

integer $spinCount

Returns

self

getAlgorithm()

getAlgorithm() : string

Get algorithm

Returns

string

setAlgorithm()

setAlgorithm(string  $algorithm) : self

Set algorithm

Parameters

string $algorithm

Returns

self

getSalt()

getSalt() : string

Get salt

Returns

string

setSalt()

setSalt(string  $salt) : self

Set salt. Salt HAS to be 16 characters, or an exception will be thrown.

Parameters

string $salt

Throws

\InvalidArgumentException

Returns

self