\PhpZip\Model\ExtraExtraFieldsCollection

Represents a collection of Extra Fields as they may be present at several locations in ZIP files.

Summary

Methods
Properties
Constants
count()
get()
add()
addAll()
addCollection()
getAll()
has()
remove()
offsetExists()
offsetGet()
offsetSet()
offsetUnset()
current()
next()
key()
valid()
rewind()
clear()
__toString()
__clone()
No public properties found
No constants found
No protected methods found
$collection
N/A
validateHeaderId()
No private properties found
N/A

Properties

$collection

$collection : \PhpZip\Model\Extra\ZipExtraField[]

The map of Extra Fields.

Maps from Header ID to Extra Field. Must not be null, but may be empty if no Extra Fields are used. The map is sorted by Header IDs in ascending order.

Type

ZipExtraField[]

Methods

count()

count() : int

Returns the number of Extra Fields in this collection.

Returns

int —

get()

get(int  $headerId) : \PhpZip\Model\Extra\ZipExtraField|null

Returns the Extra Field with the given Header ID or null if no such Extra Field exists.

Parameters

int $headerId

the requested Header ID

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

the Extra Field with the given Header ID or if no such Extra Field exists

add()

add(\PhpZip\Model\Extra\ZipExtraField  $extraField) : \PhpZip\Model\Extra\ZipExtraField

Stores the given Extra Field in this collection.

Parameters

\PhpZip\Model\Extra\ZipExtraField $extraField

the Extra Field to store in this collection

Returns

\PhpZip\Model\Extra\ZipExtraField —

the Extra Field previously associated with the Header ID of of the given Extra Field or null if no such Extra Field existed

addAll()

addAll(\PhpZip\Model\Extra\ZipExtraField[]  $extraFields) : mixed

Parameters

\PhpZip\Model\Extra\ZipExtraField[] $extraFields

Returns

mixed —

addCollection()

addCollection(\PhpZip\Model\Extra\ExtraFieldsCollection  $collection) : mixed

Parameters

\PhpZip\Model\Extra\ExtraFieldsCollection $collection

Returns

mixed —

getAll()

getAll() : \PhpZip\Model\Extra\ZipExtraField[]

Returns

\PhpZip\Model\Extra\ZipExtraField[] —

has()

has(int  $headerId) : bool

Returns Extra Field exists.

Parameters

int $headerId

the requested Header ID

Returns

bool —

remove()

remove(int  $headerId) : \PhpZip\Model\Extra\ZipExtraField|null

Removes the Extra Field with the given Header ID.

Parameters

int $headerId

the requested Header ID

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

the Extra Field with the given Header ID or null if no such Extra Field exists

offsetExists()

offsetExists(int  $offset) : bool

Whether a offset exists.

Parameters

int $offset

an offset to check for

Returns

bool —

true on success or false on failure

offsetGet()

offsetGet(int  $offset) : \PhpZip\Model\Extra\ZipExtraField|null

Offset to retrieve.

Parameters

int $offset

the offset to retrieve

Returns

\PhpZip\Model\Extra\ZipExtraField|null —

offsetSet()

offsetSet(mixed  $offset, \PhpZip\Model\Extra\ZipExtraField  $value) : mixed

Offset to set.

Parameters

mixed $offset

the offset to assign the value to

\PhpZip\Model\Extra\ZipExtraField $value

the value to set

Returns

mixed —

offsetUnset()

offsetUnset(mixed  $offset) : mixed

Offset to unset.

Parameters

mixed $offset

the offset to unset

Returns

mixed —

current()

current() : \PhpZip\Model\Extra\ZipExtraField

Return the current element.

Returns

\PhpZip\Model\Extra\ZipExtraField —

next()

next() : mixed

Move forward to next element.

Returns

mixed —

key()

key() : int

Return the key of the current element.

Returns

int —

scalar on success, or null on failure

valid()

valid() : bool

Checks if current position is valid.

Returns

bool —

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

rewind()

rewind() : mixed

Rewind the Iterator to the first element.

Returns

mixed —

clear()

clear() : mixed

Returns

mixed —

__toString()

__toString() : string

Returns

string —

__clone()

__clone() : mixed

If clone extra fields.

Returns

mixed —

validateHeaderId()

validateHeaderId(int  $headerId) : mixed

Parameters

int $headerId

Returns

mixed —