Blesta Source Documentation

MassMailerJobs extends MassMailerModel

MassMailerJobs model

Table of Contents

Methods

add() Creates a new job for the current company
edit() Updates the job to set the status
getAll() Retrieves all jobs for the current company
getList() Retrieves a list of jobs for the current company
getListCount() Retrieves the total list of jobs for the current company
getStatuses() Retrieves a set of statuses
getJobs() Builds a select query for fetching jobs
getRules() Retrieves a set of rules for validating whether to add a job
Methods

add()

Creates a new job for the current company

public add(array<string|int, mixed> $vars) : mixed
Parameters
$vars : array<string|int, mixed>

An array of input including:

  • status The job status (optional, default 'pending')
  • task_count The total number of tasks on the job
  • data An array of data to save for this job, e.g.
    • filters An array of all filter attributes
Return values
mixed

The ID of the job created, or void on error

edit()

Updates the job to set the status

public edit(int $job_id, array<string|int, mixed> $vars) : stdClass
Parameters
$job_id : int

The ID of the job to update

$vars : array<string|int, mixed>

An array of input including:

  • status The job status
  • task_count The total number of tasks on the job
Return values
stdClass

The updated job

getAll()

Retrieves all jobs for the current company

public getAll([string $type = null ][, array<string|int, mixed> $statuses = [] ]) : array<string|int, mixed>
Parameters
$type : string = null

The type of job to fetch (i.e. 'email' or 'export', default null for both)

$statuses : array<string|int, mixed> = []

An array of statuses to filter by (optional)

Return values
array<string|int, mixed>

An array of stdClass objects representing each job

getList()

Retrieves a list of jobs for the current company

public getList([int $page = 1 ]) : array<string|int, mixed>
Parameters
$page : int = 1

The page of results to fetch (optional, default 1)

Return values
array<string|int, mixed>

An array of stdClass objects representing each job

getListCount()

Retrieves the total list of jobs for the current company

public getListCount() : int
Return values
int

The total number of jobs

getStatuses()

Retrieves a set of statuses

public getStatuses() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of statuses and their language

getJobs()

Builds a select query for fetching jobs

private getJobs() : Record
Return values
Record

A partially-constructed Record object

getRules()

Retrieves a set of rules for validating whether to add a job

private getRules(array<string|int, mixed> $vars[, bool $edit = false ]) : array<string|int, mixed>
Parameters
$vars : array<string|int, mixed>

An array of input

$edit : bool = false

True for the edit rules, false for the add rules

Return values
array<string|int, mixed>

A set of rules for Input validation

Tags
subpackage

plugins.massmailer.models

copyright

Copyright (c) 2016, Phillips Data, Inc.

license

http://www.blesta.com/license/ The Blesta License Agreement

link

Blesta


        
On this page

Search results