Mail
extends AbstractWriter
in package
Mail log writer class
Tags
Table of Contents
Properties
- $emails : array<string|int, mixed>
- Emails to which to send the log messages
- $limit : int|null
- Log limit
- $mailer : Mailer|null
- Mailer object
- $options : array<string|int, mixed>
- Array of mail-specific options, i.e. subject, headers, etc.
Methods
- __construct() : mixed
- Constructor
- addEmails() : Mail
- Add emails
- addOption() : Mail
- Add option
- addOptions() : Mail
- Add options
- getContext() : string
- Get context for log
- getEmails() : array<string|int, mixed>
- Get emails
- getLogLimit() : int|null
- Get log limit
- getMailer() : Mailer
- Get mailer
- getOptions() : array<string|int, mixed>
- Get options
- hasLogLimit() : bool
- Has log limit
- isWithinLogLimit() : bool
- Check if a log level is within the set log level limit
- setEmails() : Mail
- Set emails
- setLogLimit() : AbstractWriter
- Set log limit
- setOptions() : Mail
- Set options
- writeLog() : Mail
- Write to the log
Properties
$emails
Emails to which to send the log messages
protected
array<string|int, mixed>
$emails
= []
$limit
Log limit
protected
int|null
$limit
= null
$mailer
Mailer object
protected
Mailer|null
$mailer
= null
$options
Array of mail-specific options, i.e. subject, headers, etc.
protected
array<string|int, mixed>
$options
= []
Methods
__construct()
Constructor
public
__construct(Mailer $mailer, mixed $emails[, array<string|int, mixed> $options = [] ]) : mixed
Instantiate the Mail writer object
Parameters
- $mailer : Mailer
- $emails : mixed
- $options : array<string|int, mixed> = []
addEmails()
Add emails
public
addEmails(mixed $emails) : Mail
Parameters
- $emails : mixed
Return values
MailaddOption()
Add option
public
addOption(mixed $option, mixed $value) : Mail
Parameters
- $option : mixed
- $value : mixed
Return values
MailaddOptions()
Add options
public
addOptions(array<string|int, mixed> $options) : Mail
Parameters
- $options : array<string|int, mixed>
Return values
MailgetContext()
Get context for log
public
getContext([array<string|int, mixed> $context = [] ]) : string
Parameters
- $context : array<string|int, mixed> = []
Return values
stringgetEmails()
Get emails
public
getEmails() : array<string|int, mixed>
Return values
array<string|int, mixed>getLogLimit()
Get log limit
public
getLogLimit() : int|null
Return values
int|nullgetMailer()
Get mailer
public
getMailer() : Mailer
Return values
MailergetOptions()
Get options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>hasLogLimit()
Has log limit
public
hasLogLimit() : bool
Return values
boolisWithinLogLimit()
Check if a log level is within the set log level limit
public
isWithinLogLimit(int $level) : bool
Parameters
- $level : int
Return values
boolsetEmails()
Set emails
public
setEmails(mixed $emails) : Mail
Parameters
- $emails : mixed
Return values
MailsetLogLimit()
Set log limit
public
setLogLimit(int $level) : AbstractWriter
Parameters
- $level : int
Return values
AbstractWritersetOptions()
Set options
public
setOptions(array<string|int, mixed> $options) : Mail
Parameters
- $options : array<string|int, mixed>
Return values
MailwriteLog()
Write to the log
public
writeLog(mixed $level, string $message[, array<string|int, mixed> $context = [] ]) : Mail
Parameters
- $level : mixed
- $message : string
- $context : array<string|int, mixed> = []