BodyStructureCollection
class BodyStructureCollection implements Arrayable, Countable, IteratorAggregate, JsonSerializable (View source)
Methods
Constructor.
Parse a multipart BODYSTRUCTURE ListData into a BodyStructureCollection.
Determine if a ListData represents a disposition (INLINE or ATTACHMENT).
Get the multipart subtype (mixed, alternative, related, etc.).
Get the content type.
Get the parameters (e.g., boundary).
Get the boundary parameter.
Get the direct child parts.
Get all parts flattened (including nested parts).
Find a part by its part number.
Get the text/plain part if available.
Get the text/html part if available.
Get all attachment parts.
Determine if the collection has attachments.
Get the count of attachments.
Get the count of parts.
Get an iterator for the parts.
Get the array representation.
Get the JSON representation.
Details
__construct(string $subtype = 'mixed', array $parameters = [], array $parts = [])
Constructor.
static BodyStructureCollection
fromListData(ListData $data, string|null $partNumber = null)
Parse a multipart BODYSTRUCTURE ListData into a BodyStructureCollection.
static protected bool
isMultipart(ListData $data)
Determine if a ListData represents a multipart structure.
static protected bool
isDispositionList(ListData $data)
Determine if a ListData represents a disposition (INLINE or ATTACHMENT).
string
subtype()
Get the multipart subtype (mixed, alternative, related, etc.).
string
contentType()
Get the content type.
array
parameters()
Get the parameters (e.g., boundary).
string|null
boundary()
Get the boundary parameter.
array
parts()
Get the direct child parts.
array
flatten()
Get all parts flattened (including nested parts).
BodyStructurePart|BodyStructureCollection|null
find(string $partNumber)
Find a part by its part number.
BodyStructurePart|null
text()
Get the text/plain part if available.
BodyStructurePart|null
html()
Get the text/html part if available.
array
attachments()
Get all attachment parts.
bool
hasAttachments()
Determine if the collection has attachments.
int
attachmentCount()
Get the count of attachments.
int
count()
Get the count of parts.
Traversable
getIterator()
Get an iterator for the parts.
array
toArray()
Get the array representation.
array
jsonSerialize()
Get the JSON representation.