Copied!

Header container representing the start line of a uu-encoded part.

The line may contain a unix file mode and a filename.

CloneableInstantiableIterable
Methods
public ZBateson\MailMimeParser\Message\PartHeaderContainer::__construct(ZBateson\MailMimeParser\Header\HeaderFactory $headerFactory, ?ZBateson\MailMimeParser\Message\PartHeaderContainer $cloneSource = NULL)
 

Pass a PartHeaderContainer as the second parameter. This is useful when creating a new MimePart with this PartHeaderContainer and the original container is needed for parsing and changes to the header in the part should not affect parsing.

  • param \PartHeaderContainer $cloneSource the original container to clone from
public ZBateson\MailMimeParser\Message\PartHeaderContainer::add( $name, $value)
 

Adds the header to the collection.

  • param string $name
  • param string $value
public ZBateson\MailMimeParser\Message\PartHeaderContainer::exists( $name, $offset = 0)
 

Returns true if the passed header exists in this collection.

  • param string $name
  • param int $offset
  • return bool
public ZBateson\MailMimeParser\Message\PartHeaderContainer::get(string $name, int $offset = 0)
 

Returns the IHeader object for the header with the given $name, or null if none exist.

An optional offset can be provided, which defaults to the first header in the collection when more than one header with the same name exists.

Note that mime headers aren't case sensitive.

  • param string $name
  • param int $offset
  • return \ZBateson\MailMimeParser\Header\IHeader|null
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getAll( $name)
 

Returns all headers with the passed name.

  • param string $name
  • return \ZBateson\MailMimeParser\Header\IHeader[]
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getAs(string $name, string $iHeaderClass, int $offset = 0) : ?ZBateson\MailMimeParser\Header\IHeader
 

Returns the IHeader object for the header with the given $name, or null if none exist, using the passed $iHeaderClass to construct it.

An optional offset can be provided, which defaults to the first header in the collection when more than one header with the same name exists.

Note that mime headers aren't case sensitive.

  • param string $name
  • param string $iHeaderClass
  • param int $offset
  • return ?\IHeader
public getFilename() : ?string
 

Returns the filename included in the uuencoded 'begin' line for this part.

  • return string
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getHeaderObjects()
 

Returns an array of IHeader objects representing all headers in this collection.

  • return \ZBateson\MailMimeParser\Header\IHeader[]
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getHeaders()
 

Returns an array of headers in this collection. Each returned element in the array is an array with the first element set to the name, and the second its value:

[ [ 'Header-Name', 'Header Value' ], [ 'Second-Header-Name', 'Second-Header-Value' ], // etc... ]

  • return string[][]
public ZBateson\MailMimeParser\Message\PartHeaderContainer::getIterator()
 

Returns an iterator to the headers in this collection. Each returned element is an array with its first element set to the header's name, and the second to its value:

[ 'Header-Name', 'Header Value' ]

  • return \ArrayIterator
  • attribute ReturnTypeWillChange
public getUnixFileMode() : ?int
 

Returns the file mode included in the uuencoded 'begin' line for this part.

public ZBateson\MailMimeParser\Message\PartHeaderContainer::remove( $name, $offset = 0)
 

Removes the header from the collection with the passed name. Defaults to removing the first instance of the header for a collection that contains more than one with the same passed name.

  • param string $name
  • param int $offset
  • return bool if a header was removed.
public ZBateson\MailMimeParser\Message\PartHeaderContainer::removeAll( $name)
 

Removes all headers that match the passed name.

  • param string $name
  • return bool true if one or more headers were removed.
public ZBateson\MailMimeParser\Message\PartHeaderContainer::set( $name, $value, $offset = 0) : self
 

If a header exists with the passed name, and at the passed offset if more than one exists, its value is updated.

If a header with the passed name doesn't exist at the passed offset, it is created at the next available offset (offset is ignored when adding).

  • param string $name
  • param string $value
  • param int $offset
public setFilename(string $filename)
 

Sets the filename included in the uuencoded 'begin' line.

  • return static
public setUnixFileMode(int $mode)
 

Sets the unix file mode for the uuencoded 'begin' line.

  • return static
Properties
protected $filename = NULL
 
  • var string the name of the file in the uuencoding 'header'.
protected ZBateson\MailMimeParser\Message\PartHeaderContainer::$headerFactory = NULL
 
  • var \HeaderFactory the HeaderFactory object used for created headers
protected $mode = NULL
 
  • var int the unix file permission
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration