3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Mailing/Spool.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:79a17f549e804c08e52dd5bccc546c3c)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Mailing_DAO_Spool
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_mailing_spool';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
95 * The email of the receipients this mail is to be sent.
99 public $recipient_email;
101 * The header information of this mailing .
107 * The body of this mailing.
113 * date on which this job was added.
119 * date on which this job was removed.
127 * @return civicrm_mailing_spool
129 function __construct() {
130 $this->__table
= 'civicrm_mailing_spool';
131 parent
::__construct();
134 * Returns foreign keys and entity references
137 * [CRM_Core_Reference_Interface]
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');
144 return self
::$_links;
147 * Returns all the column names of this table
151 static function &fields() {
152 if (!(self
::$_fields)) {
153 self
::$_fields = array(
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Spool ID') ,
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Mailing Job') ,
164 'description' => 'The ID of the Job .',
166 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
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.',
176 'type' => CRM_Utils_Type
::T_TEXT
,
177 'title' => ts('Headers') ,
178 'description' => 'The header information of this mailing .',
182 'type' => CRM_Utils_Type
::T_TEXT
,
183 'title' => ts('Body') ,
184 'description' => 'The body of this mailing.',
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.',
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.',
200 return self
::$_fields;
203 * Returns an array containing, for each field, the arary key used for that
204 * field in self::$_fields.
208 static function &fieldKeys() {
209 if (!(self
::$_fieldKeys)) {
210 self
::$_fieldKeys = array(
212 'job_id' => 'job_id',
213 'recipient_email' => 'recipient_email',
214 'headers' => 'headers',
216 'added_at' => 'added_at',
217 'removed_at' => 'removed_at',
220 return self
::$_fieldKeys;
223 * Returns the names of this table
227 static function getTableName() {
228 return self
::$_tableName;
231 * Returns if this table needs to be logged
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
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)) {
252 self
::$_import['mailing_spool'] = & $fields[$name];
254 self
::$_import[$name] = & $fields[$name];
259 return self
::$_import;
262 * Returns the list of fields that can be exported
264 * @param bool $prefix
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)) {
275 self
::$_export['mailing_spool'] = & $fields[$name];
277 self
::$_export[$name] = & $fields[$name];
282 return self
::$_export;