MassMailerTasks extends MassMailerModel uses Filters
MassMailerTasks model
Table of Contents
Methods
| __construct() | Init |
| add() | Adds tasks for the given job that match the contact filters given. |
| delete() | Deletes the mailing task |
| get() | Retrieves a mailing task |
| getByJob() | Retrieves a single task for the given job |
| getCountByJob() | Retrieves the total number of tasks for the given job |
| buildInsertFields() | Builds a set of field names for inserting into `mass_mailer_tasks` Also sets the fields to group by |
| getRules() | Retrieves the validation rules for adding tasks |
| getTasks() | Retrieves a partially-constructed Record object for fetching tasks |
Methods
__construct()
Init
public
__construct() : mixed
add()
Adds tasks for the given job that match the contact filters given.
public
add(int $job_id, array<string|int, mixed> $filters) : mixed
Sets errors on failure
Parameters
- $job_id : int
-
The job ID to assign the tasks to
- $filters : array<string|int, mixed>
-
An array of filtering options
delete()
Deletes the mailing task
public
delete(int $task_id) : mixed
Parameters
- $task_id : int
-
The ID of the task to delete
get()
Retrieves a mailing task
public
get(int $task_id) : mixed
Parameters
- $task_id : int
-
The ID of the task to fetch
Return values
mixed —An stdClass object representing the task, otherwise false
getByJob()
Retrieves a single task for the given job
public
getByJob(int $job_id) : mixed
Parameters
- $job_id : int
-
The ID of the job
Return values
mixed —An stdClass object representing the task, otherwise false
getCountByJob()
Retrieves the total number of tasks for the given job
public
getCountByJob(int $job_id) : int
Parameters
- $job_id : int
-
The ID of the job
Return values
int —The total number of tasks currently pending for the job
buildInsertFields()
Builds a set of field names for inserting into `mass_mailer_tasks` Also sets the fields to group by
private
buildInsertFields() : string
Return values
string —The fields to include when inserting into mass_mailer_tasks
getRules()
Retrieves the validation rules for adding tasks
private
getRules() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of Input validation rules
getTasks()
Retrieves a partially-constructed Record object for fetching tasks
private
getTasks(int $job_id) : Record
Parameters
- $job_id : int
-
The ID of the job whose tasks to fetch