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:7bd4a9b64175915a43f602f4f9cfb721)
13 * Database access object for the Spool entity.
15 class CRM_Mailing_DAO_Spool
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_spool';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
46 * The email of the recipients this mail is to be sent.
50 public $recipient_email;
53 * The header information of this mailing .
60 * The body of this mailing.
67 * date on which this job was added.
74 * date on which this job was removed.
83 public function __construct() {
84 $this->__table
= 'civicrm_mailing_spool';
85 parent
::__construct();
89 * Returns localized title of this entity.
91 public static function getEntityTitle() {
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Spool ID'),
123 'where' => 'civicrm_mailing_spool.id',
124 'table_name' => 'civicrm_mailing_spool',
126 'bao' => 'CRM_Mailing_BAO_Spool',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Mailing Job'),
134 'description' => ts('The ID of the Job .'),
136 'where' => 'civicrm_mailing_spool.job_id',
137 'table_name' => 'civicrm_mailing_spool',
139 'bao' => 'CRM_Mailing_BAO_Spool',
141 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
144 'recipient_email' => [
145 'name' => 'recipient_email',
146 'type' => CRM_Utils_Type
::T_TEXT
,
147 'title' => ts('Recipient Email'),
148 'description' => ts('The email of the recipients this mail is to be sent.'),
149 'where' => 'civicrm_mailing_spool.recipient_email',
150 'table_name' => 'civicrm_mailing_spool',
152 'bao' => 'CRM_Mailing_BAO_Spool',
158 'type' => CRM_Utils_Type
::T_TEXT
,
159 'title' => ts('Headers'),
160 'description' => ts('The header information of this mailing .'),
161 'where' => 'civicrm_mailing_spool.headers',
162 'table_name' => 'civicrm_mailing_spool',
164 'bao' => 'CRM_Mailing_BAO_Spool',
170 'type' => CRM_Utils_Type
::T_TEXT
,
171 'title' => ts('Body'),
172 'description' => ts('The body of this mailing.'),
173 'where' => 'civicrm_mailing_spool.body',
174 'table_name' => 'civicrm_mailing_spool',
176 'bao' => 'CRM_Mailing_BAO_Spool',
181 'name' => 'added_at',
182 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
183 'title' => ts('Added'),
184 'description' => ts('date on which this job was added.'),
186 'where' => 'civicrm_mailing_spool.added_at',
188 'table_name' => 'civicrm_mailing_spool',
190 'bao' => 'CRM_Mailing_BAO_Spool',
195 'name' => 'removed_at',
196 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
197 'title' => ts('Removed'),
198 'description' => ts('date on which this job was removed.'),
200 'where' => 'civicrm_mailing_spool.removed_at',
202 'table_name' => 'civicrm_mailing_spool',
204 'bao' => 'CRM_Mailing_BAO_Spool',
209 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
211 return Civi
::$statics[__CLASS__
]['fields'];
215 * Return a mapping from field-name to the corresponding key (as used in fields()).
218 * Array(string $name => string $uniqueName).
220 public static function &fieldKeys() {
221 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
222 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
224 return Civi
::$statics[__CLASS__
]['fieldKeys'];
228 * Returns the names of this table
232 public static function getTableName() {
233 return self
::$_tableName;
237 * Returns if this table needs to be logged
241 public function getLog() {
246 * Returns the list of fields that can be imported
248 * @param bool $prefix
252 public static function &import($prefix = FALSE) {
253 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
258 * Returns the list of fields that can be exported
260 * @param bool $prefix
264 public static function &export($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
270 * Returns the list of indices
272 * @param bool $localize
276 public static function indices($localize = TRUE) {
278 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;