5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Spool.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:5b1d2a1cce94c7b2c330b62f3b76e2e1)
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 public static $_tableName = 'civicrm_mailing_spool';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_mailing_spool.id',
115 'table_name' => 'civicrm_mailing_spool',
117 'bao' => 'CRM_Mailing_BAO_Spool',
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Mailing Job'),
124 'description' => ts('The ID of the Job .'),
126 'where' => 'civicrm_mailing_spool.job_id',
127 'table_name' => 'civicrm_mailing_spool',
129 'bao' => 'CRM_Mailing_BAO_Spool',
131 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
133 'recipient_email' => [
134 'name' => 'recipient_email',
135 'type' => CRM_Utils_Type
::T_TEXT
,
136 'title' => ts('Recipient Email'),
137 'description' => ts('The email of the receipients this mail is to be sent.'),
138 'where' => 'civicrm_mailing_spool.recipient_email',
139 'table_name' => 'civicrm_mailing_spool',
141 'bao' => 'CRM_Mailing_BAO_Spool',
146 'type' => CRM_Utils_Type
::T_TEXT
,
147 'title' => ts('Headers'),
148 'description' => ts('The header information of this mailing .'),
149 'where' => 'civicrm_mailing_spool.headers',
150 'table_name' => 'civicrm_mailing_spool',
152 'bao' => 'CRM_Mailing_BAO_Spool',
157 'type' => CRM_Utils_Type
::T_TEXT
,
158 'title' => ts('Body'),
159 'description' => ts('The body of this mailing.'),
160 'where' => 'civicrm_mailing_spool.body',
161 'table_name' => 'civicrm_mailing_spool',
163 'bao' => 'CRM_Mailing_BAO_Spool',
167 'name' => 'added_at',
168 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
169 'title' => ts('Added'),
170 'description' => ts('date on which this job was added.'),
172 'where' => 'civicrm_mailing_spool.added_at',
174 'table_name' => 'civicrm_mailing_spool',
176 'bao' => 'CRM_Mailing_BAO_Spool',
180 'name' => 'removed_at',
181 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
182 'title' => ts('Removed'),
183 'description' => ts('date on which this job was removed.'),
185 'where' => 'civicrm_mailing_spool.removed_at',
187 'table_name' => 'civicrm_mailing_spool',
189 'bao' => 'CRM_Mailing_BAO_Spool',
193 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
195 return Civi
::$statics[__CLASS__
]['fields'];
199 * Return a mapping from field-name to the corresponding key (as used in fields()).
202 * Array(string $name => string $uniqueName).
204 public static function &fieldKeys() {
205 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
206 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
208 return Civi
::$statics[__CLASS__
]['fieldKeys'];
212 * Returns the names of this table
216 public static function getTableName() {
217 return self
::$_tableName;
221 * Returns if this table needs to be logged
225 public function getLog() {
230 * Returns the list of fields that can be imported
232 * @param bool $prefix
236 public static function &import($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
242 * Returns the list of fields that can be exported
244 * @param bool $prefix
248 public static function &export($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
254 * Returns the list of indices
256 * @param bool $localize
260 public static function indices($localize = TRUE) {
262 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;