Body
in package
MIME part body class
Tags
Table of Contents
Properties
- $content : string|null
- Content
- $encoding : Encoding|null
- Encoding
- $file : string|null
- Pending file path - set by setContentFromFile(), read lazily by render()/getContent(), never both this and $content set at once.
- $isEncoded : bool
- Is encoded flag
- $isFile : bool
- Is file flag
- $split : int|bool|null
- Chunk split
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- Render the body
- getContent() : string
- Get the body content
- getEncoding() : Encoding|null
- Get the encoding
- getSplit() : int|bool
- Get the split
- hasContent() : bool
- Has body content
- hasEncoding() : bool
- Has encoding
- hasSplit() : bool
- Has split
- is7BitEncoding() : bool
- Is encoding 7bit
- is8BitEncoding() : bool
- Is encoding 8bit
- isBase64Encoding() : bool
- Is encoding base64
- isBinaryEncoding() : bool
- Is encoding binary
- isEncoded() : bool
- Is encoded
- isFile() : bool
- Is file
- isQuotedPrintableEncoding() : bool
- Is encoding quoted-printable
- isRawUrlEncoding() : bool
- Is encoding raw URL
- isUrlEncoding() : bool
- Is encoding URL
- render() : string
- Render the body
- setAsEncoded() : Body
- Set as encoded
- setAsFile() : Body
- Set as file
- setContent() : Body
- Set the body content
- setContentFromFile() : Body
- Set the body content from file
- setEncoding() : Body
- Set the encoding
- setSplit() : Body
- Set the split
- loadFileContent() : void
- Materialize a pending file's content, if one is set - lazy, so a Body that's never rendered or read never touches the filesystem.
Properties
$content
Content
protected
string|null
$content
= null
$encoding
Encoding
protected
Encoding|null
$encoding
= null
$file
Pending file path - set by setContentFromFile(), read lazily by render()/getContent(), never both this and $content set at once.
protected
string|null
$file
= null
$isEncoded
Is encoded flag
protected
bool
$isEncoded
= false
$isFile
Is file flag
protected
bool
$isFile
= false
$split
Chunk split
protected
int|bool|null
$split
= null
Methods
__construct()
Constructor
public
__construct([string|null $content = null ][, Encoding|null $encoding = null ][, int|bool|null $split = null ]) : mixed
Instantiate the body object
Parameters
- $content : string|null = null
- $encoding : Encoding|null = null
- $split : int|bool|null = null
__toString()
Render the body
public
__toString() : string
Return values
stringgetContent()
Get the body content
public
getContent() : string
Return values
stringgetEncoding()
Get the encoding
public
getEncoding() : Encoding|null
Return values
Encoding|nullgetSplit()
Get the split
public
getSplit() : int|bool
Return values
int|boolhasContent()
Has body content
public
hasContent() : bool
Return values
boolhasEncoding()
Has encoding
public
hasEncoding() : bool
Return values
boolhasSplit()
Has split
public
hasSplit() : bool
Return values
boolis7BitEncoding()
Is encoding 7bit
public
is7BitEncoding() : bool
Return values
boolis8BitEncoding()
Is encoding 8bit
public
is8BitEncoding() : bool
Return values
boolisBase64Encoding()
Is encoding base64
public
isBase64Encoding() : bool
Return values
boolisBinaryEncoding()
Is encoding binary
public
isBinaryEncoding() : bool
Return values
boolisEncoded()
Is encoded
public
isEncoded() : bool
Return values
boolisFile()
Is file
public
isFile() : bool
Return values
boolisQuotedPrintableEncoding()
Is encoding quoted-printable
public
isQuotedPrintableEncoding() : bool
Return values
boolisRawUrlEncoding()
Is encoding raw URL
public
isRawUrlEncoding() : bool
Return values
boolisUrlEncoding()
Is encoding URL
public
isUrlEncoding() : bool
Return values
boolrender()
Render the body
public
render() : string
Return values
stringsetAsEncoded()
Set as encoded
public
setAsEncoded(bool $isEncoded) : Body
Parameters
- $isEncoded : bool
Return values
BodysetAsFile()
Set as file
public
setAsFile(bool $isFile) : Body
Parameters
- $isFile : bool
Return values
BodysetContent()
Set the body content
public
setContent(string $content) : Body
Parameters
- $content : string
Return values
BodysetContentFromFile()
Set the body content from file
public
setContentFromFile(string $file[, Encoding|null $encoding = null ][, int|bool|null $split = null ]) : Body
Parameters
- $file : string
- $encoding : Encoding|null = null
- $split : int|bool|null = null
Tags
Return values
BodysetEncoding()
Set the encoding
public
setEncoding(Encoding $encoding) : Body
Parameters
- $encoding : Encoding
Return values
BodysetSplit()
Set the split
public
setSplit(int|bool $split) : Body
Parameters
- $split : int|bool
Return values
BodyloadFileContent()
Materialize a pending file's content, if one is set - lazy, so a Body that's never rendered or read never touches the filesystem.
protected
loadFileContent() : void