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