Regenerate DAO files
[civicrm-core.git] / CRM / Mailing / DAO / Spool.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Mailing/Spool.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e6ca0a57 9 * (GenCodeChecksum:55c696d855ff602c9e097bd9ccff0971)
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 */
fa45b5b9 22 public 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 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b 31 /**
e6ca0a57 32 * @var int
e501603b
TO
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * The ID of the Job .
38 *
e6ca0a57 39 * @var int
e501603b
TO
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 93 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 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,
a36434b9 114 'where' => 'civicrm_mailing_spool.id',
522a26c9 115 'table_name' => 'civicrm_mailing_spool',
116 'entity' => 'Spool',
117 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 118 'localizable' => 0,
c3fc2621
CW
119 ],
120 'job_id' => [
e501603b
TO
121 'name' => 'job_id',
122 'type' => CRM_Utils_Type::T_INT,
c3fc2621 123 'title' => ts('Mailing Job'),
215b423e 124 'description' => ts('The ID of the Job .'),
c3fc2621 125 'required' => TRUE,
a36434b9 126 'where' => 'civicrm_mailing_spool.job_id',
522a26c9 127 'table_name' => 'civicrm_mailing_spool',
128 'entity' => 'Spool',
129 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 130 'localizable' => 0,
e501603b 131 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
c3fc2621
CW
132 ],
133 'recipient_email' => [
e501603b
TO
134 'name' => 'recipient_email',
135 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 136 'title' => ts('Recipient Email'),
215b423e 137 'description' => ts('The email of the receipients this mail is to be sent.'),
a36434b9 138 'where' => 'civicrm_mailing_spool.recipient_email',
522a26c9 139 'table_name' => 'civicrm_mailing_spool',
140 'entity' => 'Spool',
141 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 142 'localizable' => 0,
c3fc2621
CW
143 ],
144 'headers' => [
e501603b
TO
145 'name' => 'headers',
146 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 147 'title' => ts('Headers'),
215b423e 148 'description' => ts('The header information of this mailing .'),
a36434b9 149 'where' => 'civicrm_mailing_spool.headers',
522a26c9 150 'table_name' => 'civicrm_mailing_spool',
151 'entity' => 'Spool',
152 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 153 'localizable' => 0,
c3fc2621
CW
154 ],
155 'body' => [
e501603b
TO
156 'name' => 'body',
157 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 158 'title' => ts('Body'),
215b423e 159 'description' => ts('The body of this mailing.'),
a36434b9 160 'where' => 'civicrm_mailing_spool.body',
522a26c9 161 'table_name' => 'civicrm_mailing_spool',
162 'entity' => 'Spool',
163 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 164 'localizable' => 0,
c3fc2621
CW
165 ],
166 'added_at' => [
e501603b 167 'name' => 'added_at',
6c2b97b7 168 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 169 'title' => ts('Added'),
215b423e 170 'description' => ts('date on which this job was added.'),
c3fc2621 171 'required' => FALSE,
a36434b9 172 'where' => 'civicrm_mailing_spool.added_at',
6c2b97b7 173 'default' => 'NULL',
522a26c9 174 'table_name' => 'civicrm_mailing_spool',
175 'entity' => 'Spool',
176 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 177 'localizable' => 0,
c3fc2621
CW
178 ],
179 'removed_at' => [
e501603b 180 'name' => 'removed_at',
6c2b97b7 181 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 182 'title' => ts('Removed'),
215b423e 183 'description' => ts('date on which this job was removed.'),
c3fc2621 184 'required' => FALSE,
a36434b9 185 'where' => 'civicrm_mailing_spool.removed_at',
6c2b97b7 186 'default' => 'NULL',
522a26c9 187 'table_name' => 'civicrm_mailing_spool',
188 'entity' => 'Spool',
189 'bao' => 'CRM_Mailing_BAO_Spool',
6a7e5e5d 190 'localizable' => 0,
c3fc2621
CW
191 ],
192 ];
346aaaba 193 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 194 }
346aaaba 195 return Civi::$statics[__CLASS__]['fields'];
e501603b 196 }
c3fc2621 197
e501603b 198 /**
bd8e0b14 199 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
200 *
201 * @return array
bd8e0b14 202 * Array(string $name => string $uniqueName).
e501603b 203 */
c3fc2621 204 public static function &fieldKeys() {
bd8e0b14
TO
205 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
206 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 207 }
bd8e0b14 208 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 209 }
c3fc2621 210
e501603b
TO
211 /**
212 * Returns the names of this table
213 *
214 * @return string
215 */
c3fc2621 216 public static function getTableName() {
e501603b
TO
217 return self::$_tableName;
218 }
c3fc2621 219
e501603b
TO
220 /**
221 * Returns if this table needs to be logged
222 *
c3fc2621 223 * @return bool
e501603b 224 */
c3fc2621 225 public function getLog() {
e501603b
TO
226 return self::$_log;
227 }
c3fc2621 228
e501603b
TO
229 /**
230 * Returns the list of fields that can be imported
231 *
232 * @param bool $prefix
233 *
234 * @return array
235 */
c3fc2621
CW
236 public static function &import($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_spool', $prefix, []);
60808919 238 return $r;
e501603b 239 }
c3fc2621 240
e501603b
TO
241 /**
242 * Returns the list of fields that can be exported
243 *
244 * @param bool $prefix
245 *
246 * @return array
247 */
c3fc2621
CW
248 public static function &export($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_spool', $prefix, []);
60808919 250 return $r;
e501603b 251 }
c3fc2621 252
e7a6b91a
AS
253 /**
254 * Returns the list of indices
c3fc2621
CW
255 *
256 * @param bool $localize
257 *
258 * @return array
e7a6b91a
AS
259 */
260 public static function indices($localize = TRUE) {
c3fc2621 261 $indices = [];
e7a6b91a
AS
262 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
263 }
c3fc2621 264
e501603b 265}