fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Mailing / DAO / Spool.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Mailing/Spool.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:79a17f549e804c08e52dd5bccc546c3c)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Mailing_DAO_Spool extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_mailing_spool';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * The ID of the Job .
90 *
91 * @var int unsigned
92 */
93 public $job_id;
94 /**
95 * The email of the receipients this mail is to be sent.
96 *
97 * @var text
98 */
99 public $recipient_email;
100 /**
101 * The header information of this mailing .
102 *
103 * @var text
104 */
105 public $headers;
106 /**
107 * The body of this mailing.
108 *
109 * @var text
110 */
111 public $body;
112 /**
113 * date on which this job was added.
114 *
115 * @var datetime
116 */
117 public $added_at;
118 /**
119 * date on which this job was removed.
120 *
121 * @var datetime
122 */
123 public $removed_at;
124 /**
125 * class constructor
126 *
127 * @return civicrm_mailing_spool
128 */
129 function __construct() {
130 $this->__table = 'civicrm_mailing_spool';
131 parent::__construct();
132 }
133 /**
134 * Returns foreign keys and entity references
135 *
136 * @return array
137 * [CRM_Core_Reference_Interface]
138 */
139 static function getReferenceColumns() {
140 if (!self::$_links) {
141 self::$_links = static ::createReferenceColumns(__CLASS__);
142 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'job_id', 'civicrm_mailing_job', 'id');
143 }
144 return self::$_links;
145 }
146 /**
147 * Returns all the column names of this table
148 *
149 * @return array
150 */
151 static function &fields() {
152 if (!(self::$_fields)) {
153 self::$_fields = array(
154 'id' => array(
155 'name' => 'id',
156 'type' => CRM_Utils_Type::T_INT,
157 'title' => ts('Spool ID') ,
158 'required' => true,
159 ) ,
160 'job_id' => array(
161 'name' => 'job_id',
162 'type' => CRM_Utils_Type::T_INT,
163 'title' => ts('Mailing Job') ,
164 'description' => 'The ID of the Job .',
165 'required' => true,
166 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
167 ) ,
168 'recipient_email' => array(
169 'name' => 'recipient_email',
170 'type' => CRM_Utils_Type::T_TEXT,
171 'title' => ts('Recipient Email') ,
172 'description' => 'The email of the receipients this mail is to be sent.',
173 ) ,
174 'headers' => array(
175 'name' => 'headers',
176 'type' => CRM_Utils_Type::T_TEXT,
177 'title' => ts('Headers') ,
178 'description' => 'The header information of this mailing .',
179 ) ,
180 'body' => array(
181 'name' => 'body',
182 'type' => CRM_Utils_Type::T_TEXT,
183 'title' => ts('Body') ,
184 'description' => 'The body of this mailing.',
185 ) ,
186 'added_at' => array(
187 'name' => 'added_at',
188 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
189 'title' => ts('Added') ,
190 'description' => 'date on which this job was added.',
191 ) ,
192 'removed_at' => array(
193 'name' => 'removed_at',
194 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
195 'title' => ts('Removed') ,
196 'description' => 'date on which this job was removed.',
197 ) ,
198 );
199 }
200 return self::$_fields;
201 }
202 /**
203 * Returns an array containing, for each field, the arary key used for that
204 * field in self::$_fields.
205 *
206 * @return array
207 */
208 static function &fieldKeys() {
209 if (!(self::$_fieldKeys)) {
210 self::$_fieldKeys = array(
211 'id' => 'id',
212 'job_id' => 'job_id',
213 'recipient_email' => 'recipient_email',
214 'headers' => 'headers',
215 'body' => 'body',
216 'added_at' => 'added_at',
217 'removed_at' => 'removed_at',
218 );
219 }
220 return self::$_fieldKeys;
221 }
222 /**
223 * Returns the names of this table
224 *
225 * @return string
226 */
227 static function getTableName() {
228 return self::$_tableName;
229 }
230 /**
231 * Returns if this table needs to be logged
232 *
233 * @return boolean
234 */
235 function getLog() {
236 return self::$_log;
237 }
238 /**
239 * Returns the list of fields that can be imported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
245 static function &import($prefix = false) {
246 if (!(self::$_import)) {
247 self::$_import = array();
248 $fields = self::fields();
249 foreach($fields as $name => $field) {
250 if (CRM_Utils_Array::value('import', $field)) {
251 if ($prefix) {
252 self::$_import['mailing_spool'] = & $fields[$name];
253 } else {
254 self::$_import[$name] = & $fields[$name];
255 }
256 }
257 }
258 }
259 return self::$_import;
260 }
261 /**
262 * Returns the list of fields that can be exported
263 *
264 * @param bool $prefix
265 *
266 * @return array
267 */
268 static function &export($prefix = false) {
269 if (!(self::$_export)) {
270 self::$_export = array();
271 $fields = self::fields();
272 foreach($fields as $name => $field) {
273 if (CRM_Utils_Array::value('export', $field)) {
274 if ($prefix) {
275 self::$_export['mailing_spool'] = & $fields[$name];
276 } else {
277 self::$_export[$name] = & $fields[$name];
278 }
279 }
280 }
281 }
282 return self::$_export;
283 }
284 }