5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Spool.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:db7871e2d5313c106f01f1516beaf898)
13 * Database access object for the Spool entity.
15 class CRM_Mailing_DAO_Spool
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_spool';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
44 * The email of the receipients this mail is to be sent.
48 public $recipient_email;
51 * The header information of this mailing .
58 * The body of this mailing.
65 * date on which this job was added.
72 * date on which this job was removed.
81 public function __construct() {
82 $this->__table
= 'civicrm_mailing_spool';
83 parent
::__construct();
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Spool ID'),
114 'table_name' => 'civicrm_mailing_spool',
116 'bao' => 'CRM_Mailing_BAO_Spool',
121 'type' => CRM_Utils_Type
::T_INT
,
122 'title' => ts('Mailing Job'),
123 'description' => ts('The ID of the Job .'),
125 'table_name' => 'civicrm_mailing_spool',
127 'bao' => 'CRM_Mailing_BAO_Spool',
129 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
131 'recipient_email' => [
132 'name' => 'recipient_email',
133 'type' => CRM_Utils_Type
::T_TEXT
,
134 'title' => ts('Recipient Email'),
135 'description' => ts('The email of the receipients this mail is to be sent.'),
136 'table_name' => 'civicrm_mailing_spool',
138 'bao' => 'CRM_Mailing_BAO_Spool',
143 'type' => CRM_Utils_Type
::T_TEXT
,
144 'title' => ts('Headers'),
145 'description' => ts('The header information of this mailing .'),
146 'table_name' => 'civicrm_mailing_spool',
148 'bao' => 'CRM_Mailing_BAO_Spool',
153 'type' => CRM_Utils_Type
::T_TEXT
,
154 'title' => ts('Body'),
155 'description' => ts('The body of this mailing.'),
156 'table_name' => 'civicrm_mailing_spool',
158 'bao' => 'CRM_Mailing_BAO_Spool',
162 'name' => 'added_at',
163 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
164 'title' => ts('Added'),
165 'description' => ts('date on which this job was added.'),
168 'table_name' => 'civicrm_mailing_spool',
170 'bao' => 'CRM_Mailing_BAO_Spool',
174 'name' => 'removed_at',
175 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
176 'title' => ts('Removed'),
177 'description' => ts('date on which this job was removed.'),
180 'table_name' => 'civicrm_mailing_spool',
182 'bao' => 'CRM_Mailing_BAO_Spool',
186 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
188 return Civi
::$statics[__CLASS__
]['fields'];
192 * Return a mapping from field-name to the corresponding key (as used in fields()).
195 * Array(string $name => string $uniqueName).
197 public static function &fieldKeys() {
198 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
199 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
201 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 public static function getTableName() {
210 return self
::$_tableName;
214 * Returns if this table needs to be logged
218 public function getLog() {
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
247 * Returns the list of indices
249 * @param bool $localize
253 public static function indices($localize = TRUE) {
255 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;