Merge pull request #12925 from eileenmcnaughton/setting
[civicrm-core.git] / CRM / Mailing / DAO / Spool.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Mailing/Spool.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
6c2b97b7 9 * (GenCodeChecksum:8cdc46330195fed32b15c2560dee858d)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Spool entity.
f41f0342 14 */
e501603b 15class CRM_Mailing_DAO_Spool extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_mailing_spool';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * The ID of the Job .
38 *
39 * @var int unsigned
40 */
41 public $job_id;
c3fc2621 42
e501603b
TO
43 /**
44 * The email of the receipients this mail is to be sent.
45 *
46 * @var text
47 */
48 public $recipient_email;
c3fc2621 49
e501603b
TO
50 /**
51 * The header information of this mailing .
52 *
53 * @var text
54 */
55 public $headers;
c3fc2621 56
e501603b
TO
57 /**
58 * The body of this mailing.
59 *
60 * @var text
61 */
62 public $body;
c3fc2621 63
e501603b
TO
64 /**
65 * date on which this job was added.
66 *
6c2b97b7 67 * @var timestamp
e501603b
TO
68 */
69 public $added_at;
c3fc2621 70
e501603b
TO
71 /**
72 * date on which this job was removed.
73 *
6c2b97b7 74 * @var timestamp
e501603b
TO
75 */
76 public $removed_at;
c3fc2621 77
e501603b 78 /**
f41f0342 79 * Class constructor.
e501603b 80 */
c3fc2621 81 public function __construct() {
e501603b
TO
82 $this->__table = 'civicrm_mailing_spool';
83 parent::__construct();
84 }
c3fc2621 85
e501603b 86 /**
f41f0342 87 * Returns foreign keys and entity references.
e501603b
TO
88 *
89 * @return array
90 * [CRM_Core_Reference_Interface]
91 */
c3fc2621 92 public static function getReferenceColumns() {
346aaaba
TO
93 if (!isset(Civi::$statics[__CLASS__]['links'])) {
94 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621 95 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
346aaaba 96 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 97 }
346aaaba 98 return Civi::$statics[__CLASS__]['links'];
e501603b 99 }
c3fc2621 100
e501603b
TO
101 /**
102 * Returns all the column names of this table
103 *
104 * @return array
105 */
c3fc2621 106 public static function &fields() {
346aaaba 107 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
108 Civi::$statics[__CLASS__]['fields'] = [
109 'id' => [
e501603b
TO
110 'name' => 'id',
111 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
112 'title' => ts('Spool ID'),
113 'required' => TRUE,
522a26c9 114 'table_name' => 'civicrm_mailing_spool',
115 'entity' => 'Spool',
116 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 117 'localizable' => 0,
c3fc2621
CW
118 ],
119 'job_id' => [
e501603b
TO
120 'name' => 'job_id',
121 'type' => CRM_Utils_Type::T_INT,
c3fc2621 122 'title' => ts('Mailing Job'),
e501603b 123 'description' => 'The ID of the Job .',
c3fc2621 124 'required' => TRUE,
522a26c9 125 'table_name' => 'civicrm_mailing_spool',
126 'entity' => 'Spool',
127 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 128 'localizable' => 0,
e501603b 129 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
c3fc2621
CW
130 ],
131 'recipient_email' => [
e501603b
TO
132 'name' => 'recipient_email',
133 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 134 'title' => ts('Recipient Email'),
e501603b 135 'description' => 'The email of the receipients this mail is to be sent.',
522a26c9 136 'table_name' => 'civicrm_mailing_spool',
137 'entity' => 'Spool',
138 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 139 'localizable' => 0,
c3fc2621
CW
140 ],
141 'headers' => [
e501603b
TO
142 'name' => 'headers',
143 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 144 'title' => ts('Headers'),
e501603b 145 'description' => 'The header information of this mailing .',
522a26c9 146 'table_name' => 'civicrm_mailing_spool',
147 'entity' => 'Spool',
148 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 149 'localizable' => 0,
c3fc2621
CW
150 ],
151 'body' => [
e501603b
TO
152 'name' => 'body',
153 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 154 'title' => ts('Body'),
e501603b 155 'description' => 'The body of this mailing.',
522a26c9 156 'table_name' => 'civicrm_mailing_spool',
157 'entity' => 'Spool',
158 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 159 'localizable' => 0,
c3fc2621
CW
160 ],
161 'added_at' => [
e501603b 162 'name' => 'added_at',
6c2b97b7 163 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 164 'title' => ts('Added'),
e501603b 165 'description' => 'date on which this job was added.',
c3fc2621 166 'required' => FALSE,
6c2b97b7 167 'default' => 'NULL',
522a26c9 168 'table_name' => 'civicrm_mailing_spool',
169 'entity' => 'Spool',
170 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 171 'localizable' => 0,
c3fc2621
CW
172 ],
173 'removed_at' => [
e501603b 174 'name' => 'removed_at',
6c2b97b7 175 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 176 'title' => ts('Removed'),
e501603b 177 'description' => 'date on which this job was removed.',
c3fc2621 178 'required' => FALSE,
6c2b97b7 179 'default' => 'NULL',
522a26c9 180 'table_name' => 'civicrm_mailing_spool',
181 'entity' => 'Spool',
182 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 183 'localizable' => 0,
c3fc2621
CW
184 ],
185 ];
346aaaba 186 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 187 }
346aaaba 188 return Civi::$statics[__CLASS__]['fields'];
e501603b 189 }
c3fc2621 190
e501603b 191 /**
bd8e0b14 192 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
193 *
194 * @return array
bd8e0b14 195 * Array(string $name => string $uniqueName).
e501603b 196 */
c3fc2621 197 public static function &fieldKeys() {
bd8e0b14
TO
198 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
199 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 200 }
bd8e0b14 201 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 202 }
c3fc2621 203
e501603b
TO
204 /**
205 * Returns the names of this table
206 *
207 * @return string
208 */
c3fc2621 209 public static function getTableName() {
e501603b
TO
210 return self::$_tableName;
211 }
c3fc2621 212
e501603b
TO
213 /**
214 * Returns if this table needs to be logged
215 *
c3fc2621 216 * @return bool
e501603b 217 */
c3fc2621 218 public function getLog() {
e501603b
TO
219 return self::$_log;
220 }
c3fc2621 221
e501603b
TO
222 /**
223 * Returns the list of fields that can be imported
224 *
225 * @param bool $prefix
226 *
227 * @return array
228 */
c3fc2621
CW
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_spool', $prefix, []);
60808919 231 return $r;
e501603b 232 }
c3fc2621 233
e501603b
TO
234 /**
235 * Returns the list of fields that can be exported
236 *
237 * @param bool $prefix
238 *
239 * @return array
240 */
c3fc2621
CW
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_spool', $prefix, []);
60808919 243 return $r;
e501603b 244 }
c3fc2621 245
e7a6b91a
AS
246 /**
247 * Returns the list of indices
c3fc2621
CW
248 *
249 * @param bool $localize
250 *
251 * @return array
e7a6b91a
AS
252 */
253 public static function indices($localize = TRUE) {
c3fc2621 254 $indices = [];
e7a6b91a
AS
255 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
256 }
c3fc2621 257
e501603b 258}