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:8e8346020e4f3174bc4c4c2e87d8e136)
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',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Mailing Job'),
132 'description' => ts('The ID of the Job .'),
134 'where' => 'civicrm_mailing_spool.job_id',
135 'table_name' => 'civicrm_mailing_spool',
137 'bao' => 'CRM_Mailing_BAO_Spool',
139 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
142 'recipient_email' => [
143 'name' => 'recipient_email',
144 'type' => CRM_Utils_Type
::T_TEXT
,
145 'title' => ts('Recipient Email'),
146 'description' => ts('The email of the recipients this mail is to be sent.'),
147 'where' => 'civicrm_mailing_spool.recipient_email',
148 'table_name' => 'civicrm_mailing_spool',
150 'bao' => 'CRM_Mailing_BAO_Spool',
156 'type' => CRM_Utils_Type
::T_TEXT
,
157 'title' => ts('Headers'),
158 'description' => ts('The header information of this mailing .'),
159 'where' => 'civicrm_mailing_spool.headers',
160 'table_name' => 'civicrm_mailing_spool',
162 'bao' => 'CRM_Mailing_BAO_Spool',
168 'type' => CRM_Utils_Type
::T_TEXT
,
169 'title' => ts('Body'),
170 'description' => ts('The body of this mailing.'),
171 'where' => 'civicrm_mailing_spool.body',
172 'table_name' => 'civicrm_mailing_spool',
174 'bao' => 'CRM_Mailing_BAO_Spool',
179 'name' => 'added_at',
180 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
181 'title' => ts('Added'),
182 'description' => ts('date on which this job was added.'),
184 'where' => 'civicrm_mailing_spool.added_at',
186 'table_name' => 'civicrm_mailing_spool',
188 'bao' => 'CRM_Mailing_BAO_Spool',
193 'name' => 'removed_at',
194 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
195 'title' => ts('Removed'),
196 'description' => ts('date on which this job was removed.'),
198 'where' => 'civicrm_mailing_spool.removed_at',
200 'table_name' => 'civicrm_mailing_spool',
202 'bao' => 'CRM_Mailing_BAO_Spool',
207 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
209 return Civi
::$statics[__CLASS__
]['fields'];
213 * Return a mapping from field-name to the corresponding key (as used in fields()).
216 * Array(string $name => string $uniqueName).
218 public static function &fieldKeys() {
219 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
220 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
222 return Civi
::$statics[__CLASS__
]['fieldKeys'];
226 * Returns the names of this table
230 public static function getTableName() {
231 return self
::$_tableName;
235 * Returns if this table needs to be logged
239 public function getLog() {
244 * Returns the list of fields that can be imported
246 * @param bool $prefix
250 public static function &import($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
256 * Returns the list of fields that can be exported
258 * @param bool $prefix
262 public static function &export($prefix = FALSE) {
263 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
268 * Returns the list of indices
270 * @param bool $localize
274 public static function indices($localize = TRUE) {
276 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;