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:f2aa2d8c8ee3203bf674e6c193818dda)
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.
92 * Whether to return the plural version of the title.
94 public static function getEntityTitle($plural = FALSE) {
95 return $plural ?
ts('Spools') : ts('Spool');
99 * Returns foreign keys and entity references.
102 * [CRM_Core_Reference_Interface]
104 public static function getReferenceColumns() {
105 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
106 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
107 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
108 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
110 return Civi
::$statics[__CLASS__
]['links'];
114 * Returns all the column names of this table
118 public static function &fields() {
119 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
120 Civi
::$statics[__CLASS__
]['fields'] = [
123 'type' => CRM_Utils_Type
::T_INT
,
124 'title' => ts('Spool ID'),
126 'where' => 'civicrm_mailing_spool.id',
127 'table_name' => 'civicrm_mailing_spool',
129 'bao' => 'CRM_Mailing_BAO_Spool',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Mailing Job'),
137 'description' => ts('The ID of the Job .'),
139 'where' => 'civicrm_mailing_spool.job_id',
140 'table_name' => 'civicrm_mailing_spool',
142 'bao' => 'CRM_Mailing_BAO_Spool',
144 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
147 'recipient_email' => [
148 'name' => 'recipient_email',
149 'type' => CRM_Utils_Type
::T_TEXT
,
150 'title' => ts('Recipient Email'),
151 'description' => ts('The email of the recipients this mail is to be sent.'),
152 'where' => 'civicrm_mailing_spool.recipient_email',
153 'table_name' => 'civicrm_mailing_spool',
155 'bao' => 'CRM_Mailing_BAO_Spool',
161 'type' => CRM_Utils_Type
::T_TEXT
,
162 'title' => ts('Headers'),
163 'description' => ts('The header information of this mailing .'),
164 'where' => 'civicrm_mailing_spool.headers',
165 'table_name' => 'civicrm_mailing_spool',
167 'bao' => 'CRM_Mailing_BAO_Spool',
173 'type' => CRM_Utils_Type
::T_TEXT
,
174 'title' => ts('Body'),
175 'description' => ts('The body of this mailing.'),
176 'where' => 'civicrm_mailing_spool.body',
177 'table_name' => 'civicrm_mailing_spool',
179 'bao' => 'CRM_Mailing_BAO_Spool',
184 'name' => 'added_at',
185 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
186 'title' => ts('Added'),
187 'description' => ts('date on which this job was added.'),
189 'where' => 'civicrm_mailing_spool.added_at',
191 'table_name' => 'civicrm_mailing_spool',
193 'bao' => 'CRM_Mailing_BAO_Spool',
198 'name' => 'removed_at',
199 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
200 'title' => ts('Removed'),
201 'description' => ts('date on which this job was removed.'),
203 'where' => 'civicrm_mailing_spool.removed_at',
205 'table_name' => 'civicrm_mailing_spool',
207 'bao' => 'CRM_Mailing_BAO_Spool',
212 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
214 return Civi
::$statics[__CLASS__
]['fields'];
218 * Return a mapping from field-name to the corresponding key (as used in fields()).
221 * Array(string $name => string $uniqueName).
223 public static function &fieldKeys() {
224 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
225 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
227 return Civi
::$statics[__CLASS__
]['fieldKeys'];
231 * Returns the names of this table
235 public static function getTableName() {
236 return self
::$_tableName;
240 * Returns if this table needs to be logged
244 public function getLog() {
249 * Returns the list of fields that can be imported
251 * @param bool $prefix
255 public static function &import($prefix = FALSE) {
256 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
261 * Returns the list of fields that can be exported
263 * @param bool $prefix
267 public static function &export($prefix = FALSE) {
268 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
273 * Returns the list of indices
275 * @param bool $localize
279 public static function indices($localize = TRUE) {
281 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;