5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Spool.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:20306dd6c4ce1990d47a78f8cd42606a)
13 * Database access object for the Spool entity.
15 class CRM_Mailing_DAO_Spool
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_spool';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
47 * The email of the recipients this mail is to be sent.
51 public $recipient_email;
54 * The header information of this mailing .
61 * The body of this mailing.
68 * date on which this job was added.
75 * date on which this job was removed.
84 public function __construct() {
85 $this->__table
= 'civicrm_mailing_spool';
86 parent
::__construct();
90 * Returns localized title of this entity.
93 * Whether to return the plural version of the title.
95 public static function getEntityTitle($plural = FALSE) {
96 return $plural ?
ts('Spools') : ts('Spool');
100 * Returns foreign keys and entity references.
103 * [CRM_Core_Reference_Interface]
105 public static function getReferenceColumns() {
106 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
107 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
108 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
109 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
111 return Civi
::$statics[__CLASS__
]['links'];
115 * Returns all the column names of this table
119 public static function &fields() {
120 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
121 Civi
::$statics[__CLASS__
]['fields'] = [
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Spool ID'),
127 'where' => 'civicrm_mailing_spool.id',
128 'table_name' => 'civicrm_mailing_spool',
130 'bao' => 'CRM_Mailing_BAO_Spool',
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Mailing Job'),
138 'description' => ts('The ID of the Job .'),
140 'where' => 'civicrm_mailing_spool.job_id',
141 'table_name' => 'civicrm_mailing_spool',
143 'bao' => 'CRM_Mailing_BAO_Spool',
145 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
148 'recipient_email' => [
149 'name' => 'recipient_email',
150 'type' => CRM_Utils_Type
::T_TEXT
,
151 'title' => ts('Recipient Email'),
152 'description' => ts('The email of the recipients this mail is to be sent.'),
153 'where' => 'civicrm_mailing_spool.recipient_email',
154 'table_name' => 'civicrm_mailing_spool',
156 'bao' => 'CRM_Mailing_BAO_Spool',
162 'type' => CRM_Utils_Type
::T_TEXT
,
163 'title' => ts('Headers'),
164 'description' => ts('The header information of this mailing .'),
165 'where' => 'civicrm_mailing_spool.headers',
166 'table_name' => 'civicrm_mailing_spool',
168 'bao' => 'CRM_Mailing_BAO_Spool',
174 'type' => CRM_Utils_Type
::T_TEXT
,
175 'title' => ts('Body'),
176 'description' => ts('The body of this mailing.'),
177 'where' => 'civicrm_mailing_spool.body',
178 'table_name' => 'civicrm_mailing_spool',
180 'bao' => 'CRM_Mailing_BAO_Spool',
185 'name' => 'added_at',
186 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
187 'title' => ts('Added'),
188 'description' => ts('date on which this job was added.'),
190 'where' => 'civicrm_mailing_spool.added_at',
192 'table_name' => 'civicrm_mailing_spool',
194 'bao' => 'CRM_Mailing_BAO_Spool',
199 'name' => 'removed_at',
200 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
201 'title' => ts('Removed'),
202 'description' => ts('date on which this job was removed.'),
204 'where' => 'civicrm_mailing_spool.removed_at',
206 'table_name' => 'civicrm_mailing_spool',
208 'bao' => 'CRM_Mailing_BAO_Spool',
213 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
215 return Civi
::$statics[__CLASS__
]['fields'];
219 * Return a mapping from field-name to the corresponding key (as used in fields()).
222 * Array(string $name => string $uniqueName).
224 public static function &fieldKeys() {
225 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
226 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
228 return Civi
::$statics[__CLASS__
]['fieldKeys'];
232 * Returns the names of this table
236 public static function getTableName() {
237 return self
::$_tableName;
241 * Returns if this table needs to be logged
245 public function getLog() {
250 * Returns the list of fields that can be imported
252 * @param bool $prefix
256 public static function &import($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
262 * Returns the list of fields that can be exported
264 * @param bool $prefix
268 public static function &export($prefix = FALSE) {
269 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
274 * Returns the list of indices
276 * @param bool $localize
280 public static function indices($localize = TRUE) {
282 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;