ParserPartChildrenContainer
extends PartChildrenContainer
in package
A child container that proxies calls to a parser when attempting to access child parts.
Tags
Table of Contents
- $children : array<string|int, mixed>
- $parserProxy : ParserMimePartProxy
- $position : int
- $allParsed : bool
- __construct() : mixed
- add() : static
- Adds the passed IMessagePart to the container in the passed position.
- current() : IMessagePart
- getChildren() : RecursiveIterator<string|int, IMessagePart>|null
- If the current element points to an IMultiPart, its child iterator is returned by calling {@see IMultiPart::getChildIterator()}.
- hasChildren() : bool
- Returns true if the current element is an IMultiPart. Note that the iterator may still be empty.
- key() : int
- next() : void
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- remove() : int
- Removes the passed part, and returns the integer position it occupied.
- rewind() : void
- valid() : bool
Properties
$children
protected
array<string|int, mixed>
$children
array of child parts of the IMultiPart object that is holding this container.
$parserProxy
protected
ParserMimePartProxy
$parserProxy
The parser to proxy requests to when trying to get child parts.
$position
protected
int
$position
= 0
current key position within $children for iteration.
$allParsed
private
bool
$allParsed
= false
Set to true once all parts have been parsed, and requests to the proxy won't result in any more child parts.
Methods
__construct()
public
__construct(ParserMimePartProxy $parserProxy) : mixed
Parameters
- $parserProxy : ParserMimePartProxy
Return values
mixed —add()
Adds the passed IMessagePart to the container in the passed position.
public
add(IMessagePart $part[, int $position = null ]) : static
If position is not passed or null, the part is added to the end, as the last child in the container.
Parameters
- $part : IMessagePart
-
The part to add
- $position : int = null
-
An optional index position (0-based) to add the child at.
Return values
static —current()
public
current() : IMessagePart
Return values
IMessagePart —getChildren()
If the current element points to an IMultiPart, its child iterator is returned by calling {@see IMultiPart::getChildIterator()}.
public
getChildren() : RecursiveIterator<string|int, IMessagePart>|null
Return values
RecursiveIterator<string|int, IMessagePart>|null —the iterator
hasChildren()
Returns true if the current element is an IMultiPart. Note that the iterator may still be empty.
public
hasChildren() : bool
Return values
bool —key()
public
key() : int
Return values
int —next()
public
next() : void
Return values
void —offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
bool —offsetGet()
public
offsetGet(int $offset) : mixed
Parameters
- $offset : int
Return values
mixed —offsetSet()
public
offsetSet(int $offset, IMessagePart $value) : void
Parameters
- $offset : int
- $value : IMessagePart
Return values
void —offsetUnset()
public
offsetUnset(int $offset) : void
Parameters
- $offset : int
Return values
void —remove()
Removes the passed part, and returns the integer position it occupied.
public
remove(IMessagePart $part) : int
Parameters
- $part : IMessagePart
-
The part to remove.
Return values
int —the 0-based position it previously occupied.
rewind()
public
rewind() : void
Return values
void —valid()
public
valid() : bool