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:37cfd90aa2697070996f893259692b4b)
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
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_spool';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
47 * The email of the recipients this mail is to be sent.
51 public $recipient_email;
54 * The header information of this mailing .
61 * The body of this mailing.
68 * date on which this job was added.
75 * date on which this job was removed.
84 public function __construct() {
85 $this->__table
= 'civicrm_mailing_spool';
86 parent
::__construct();
90 * Returns localized title of this entity.
93 * Whether to return the plural version of the title.
95 public static function getEntityTitle($plural = FALSE) {
96 return $plural ?
ts('Spools') : ts('Spool');
100 * Returns foreign keys and entity references.
103 * [CRM_Core_Reference_Interface]
105 public static function getReferenceColumns() {
106 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
107 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
108 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
109 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
111 return Civi
::$statics[__CLASS__
]['links'];
115 * Returns all the column names of this table
119 public static function &fields() {
120 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
121 Civi
::$statics[__CLASS__
]['fields'] = [
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Spool ID'),
127 'where' => 'civicrm_mailing_spool.id',
128 'table_name' => 'civicrm_mailing_spool',
130 'bao' => 'CRM_Mailing_BAO_Spool',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Job ID'),
142 'description' => ts('The ID of the Job .'),
144 'where' => 'civicrm_mailing_spool.job_id',
145 'table_name' => 'civicrm_mailing_spool',
147 'bao' => 'CRM_Mailing_BAO_Spool',
149 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
151 'label' => ts("Job"),
155 'recipient_email' => [
156 'name' => 'recipient_email',
157 'type' => CRM_Utils_Type
::T_TEXT
,
158 'title' => ts('Recipient Email'),
159 'description' => ts('The email of the recipients this mail is to be sent.'),
160 'where' => 'civicrm_mailing_spool.recipient_email',
161 'table_name' => 'civicrm_mailing_spool',
163 'bao' => 'CRM_Mailing_BAO_Spool',
169 'type' => CRM_Utils_Type
::T_TEXT
,
170 'title' => ts('Headers'),
171 'description' => ts('The header information of this mailing .'),
172 'where' => 'civicrm_mailing_spool.headers',
173 'table_name' => 'civicrm_mailing_spool',
175 'bao' => 'CRM_Mailing_BAO_Spool',
181 'type' => CRM_Utils_Type
::T_TEXT
,
182 'title' => ts('Body'),
183 'description' => ts('The body of this mailing.'),
184 'where' => 'civicrm_mailing_spool.body',
185 'table_name' => 'civicrm_mailing_spool',
187 'bao' => 'CRM_Mailing_BAO_Spool',
192 'name' => 'added_at',
193 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
194 'title' => ts('Added'),
195 'description' => ts('date on which this job was added.'),
197 'where' => 'civicrm_mailing_spool.added_at',
199 'table_name' => 'civicrm_mailing_spool',
201 'bao' => 'CRM_Mailing_BAO_Spool',
206 'name' => 'removed_at',
207 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
208 'title' => ts('Removed'),
209 'description' => ts('date on which this job was removed.'),
211 'where' => 'civicrm_mailing_spool.removed_at',
213 'table_name' => 'civicrm_mailing_spool',
215 'bao' => 'CRM_Mailing_BAO_Spool',
220 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
222 return Civi
::$statics[__CLASS__
]['fields'];
226 * Return a mapping from field-name to the corresponding key (as used in fields()).
229 * Array(string $name => string $uniqueName).
231 public static function &fieldKeys() {
232 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
233 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
235 return Civi
::$statics[__CLASS__
]['fieldKeys'];
239 * Returns the names of this table
243 public static function getTableName() {
244 return self
::$_tableName;
248 * Returns if this table needs to be logged
252 public function getLog() {
257 * Returns the list of fields that can be imported
259 * @param bool $prefix
263 public static function &import($prefix = FALSE) {
264 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
269 * Returns the list of fields that can be exported
271 * @param bool $prefix
275 public static function &export($prefix = FALSE) {
276 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
281 * Returns the list of indices
283 * @param bool $localize
287 public static function indices($localize = TRUE) {
289 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;