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:96b1fb5521e4495353d74a3017db6a73)
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 recipients 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 localized title of this entity.
89 public static function getEntityTitle() {
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
99 public static function getReferenceColumns() {
100 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
101 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
103 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
105 return Civi
::$statics[__CLASS__
]['links'];
109 * Returns all the column names of this table
113 public static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = [
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Spool ID'),
121 'where' => 'civicrm_mailing_spool.id',
122 'table_name' => 'civicrm_mailing_spool',
124 'bao' => 'CRM_Mailing_BAO_Spool',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Mailing Job'),
131 'description' => ts('The ID of the Job .'),
133 'where' => 'civicrm_mailing_spool.job_id',
134 'table_name' => 'civicrm_mailing_spool',
136 'bao' => 'CRM_Mailing_BAO_Spool',
138 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
140 'recipient_email' => [
141 'name' => 'recipient_email',
142 'type' => CRM_Utils_Type
::T_TEXT
,
143 'title' => ts('Recipient Email'),
144 'description' => ts('The email of the recipients this mail is to be sent.'),
145 'where' => 'civicrm_mailing_spool.recipient_email',
146 'table_name' => 'civicrm_mailing_spool',
148 'bao' => 'CRM_Mailing_BAO_Spool',
153 'type' => CRM_Utils_Type
::T_TEXT
,
154 'title' => ts('Headers'),
155 'description' => ts('The header information of this mailing .'),
156 'where' => 'civicrm_mailing_spool.headers',
157 'table_name' => 'civicrm_mailing_spool',
159 'bao' => 'CRM_Mailing_BAO_Spool',
164 'type' => CRM_Utils_Type
::T_TEXT
,
165 'title' => ts('Body'),
166 'description' => ts('The body of this mailing.'),
167 'where' => 'civicrm_mailing_spool.body',
168 'table_name' => 'civicrm_mailing_spool',
170 'bao' => 'CRM_Mailing_BAO_Spool',
174 'name' => 'added_at',
175 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
176 'title' => ts('Added'),
177 'description' => ts('date on which this job was added.'),
179 'where' => 'civicrm_mailing_spool.added_at',
181 'table_name' => 'civicrm_mailing_spool',
183 'bao' => 'CRM_Mailing_BAO_Spool',
187 'name' => 'removed_at',
188 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
189 'title' => ts('Removed'),
190 'description' => ts('date on which this job was removed.'),
192 'where' => 'civicrm_mailing_spool.removed_at',
194 'table_name' => 'civicrm_mailing_spool',
196 'bao' => 'CRM_Mailing_BAO_Spool',
200 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
202 return Civi
::$statics[__CLASS__
]['fields'];
206 * Return a mapping from field-name to the corresponding key (as used in fields()).
209 * Array(string $name => string $uniqueName).
211 public static function &fieldKeys() {
212 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
213 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
215 return Civi
::$statics[__CLASS__
]['fieldKeys'];
219 * Returns the names of this table
223 public static function getTableName() {
224 return self
::$_tableName;
228 * Returns if this table needs to be logged
232 public function getLog() {
237 * Returns the list of fields that can be imported
239 * @param bool $prefix
243 public static function &import($prefix = FALSE) {
244 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
249 * Returns the list of fields that can be exported
251 * @param bool $prefix
255 public static function &export($prefix = FALSE) {
256 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
261 * Returns the list of indices
263 * @param bool $localize
267 public static function indices($localize = TRUE) {
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;