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:be1b386bf2b06844863726171878fb37)
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;
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
51 * The email of the recipients this mail is to be sent.
55 * Note that values will be retrieved from the database as a string.
57 public $recipient_email;
60 * The header information of this mailing .
64 * Note that values will be retrieved from the database as a string.
69 * The body of this mailing.
73 * Note that values will be retrieved from the database as a string.
78 * date on which this job was added.
81 * (SQL type: timestamp)
82 * Note that values will be retrieved from the database as a string.
87 * date on which this job was removed.
90 * (SQL type: timestamp)
91 * Note that values will be retrieved from the database as a string.
98 public function __construct() {
99 $this->__table
= 'civicrm_mailing_spool';
100 parent
::__construct();
104 * Returns localized title of this entity.
106 * @param bool $plural
107 * Whether to return the plural version of the title.
109 public static function getEntityTitle($plural = FALSE) {
110 return $plural ?
ts('Spools') : ts('Spool');
114 * Returns foreign keys and entity references.
117 * [CRM_Core_Reference_Interface]
119 public static function getReferenceColumns() {
120 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
121 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
122 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'job_id', 'civicrm_mailing_job', 'id');
123 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
125 return Civi
::$statics[__CLASS__
]['links'];
129 * Returns all the column names of this table
133 public static function &fields() {
134 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
135 Civi
::$statics[__CLASS__
]['fields'] = [
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('Spool ID'),
141 'where' => 'civicrm_mailing_spool.id',
142 'table_name' => 'civicrm_mailing_spool',
144 'bao' => 'CRM_Mailing_BAO_Spool',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Job ID'),
156 'description' => ts('The ID of the Job .'),
158 'where' => 'civicrm_mailing_spool.job_id',
159 'table_name' => 'civicrm_mailing_spool',
161 'bao' => 'CRM_Mailing_BAO_Spool',
163 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
165 'label' => ts("Job"),
169 'recipient_email' => [
170 'name' => 'recipient_email',
171 'type' => CRM_Utils_Type
::T_TEXT
,
172 'title' => ts('Recipient Email'),
173 'description' => ts('The email of the recipients this mail is to be sent.'),
174 'where' => 'civicrm_mailing_spool.recipient_email',
175 'table_name' => 'civicrm_mailing_spool',
177 'bao' => 'CRM_Mailing_BAO_Spool',
183 'type' => CRM_Utils_Type
::T_TEXT
,
184 'title' => ts('Headers'),
185 'description' => ts('The header information of this mailing .'),
186 'where' => 'civicrm_mailing_spool.headers',
187 'table_name' => 'civicrm_mailing_spool',
189 'bao' => 'CRM_Mailing_BAO_Spool',
195 'type' => CRM_Utils_Type
::T_TEXT
,
196 'title' => ts('Body'),
197 'description' => ts('The body of this mailing.'),
198 'where' => 'civicrm_mailing_spool.body',
199 'table_name' => 'civicrm_mailing_spool',
201 'bao' => 'CRM_Mailing_BAO_Spool',
206 'name' => 'added_at',
207 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
208 'title' => ts('Added'),
209 'description' => ts('date on which this job was added.'),
211 'where' => 'civicrm_mailing_spool.added_at',
213 'table_name' => 'civicrm_mailing_spool',
215 'bao' => 'CRM_Mailing_BAO_Spool',
220 'name' => 'removed_at',
221 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
222 'title' => ts('Removed'),
223 'description' => ts('date on which this job was removed.'),
225 'where' => 'civicrm_mailing_spool.removed_at',
227 'table_name' => 'civicrm_mailing_spool',
229 'bao' => 'CRM_Mailing_BAO_Spool',
234 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
236 return Civi
::$statics[__CLASS__
]['fields'];
240 * Return a mapping from field-name to the corresponding key (as used in fields()).
243 * Array(string $name => string $uniqueName).
245 public static function &fieldKeys() {
246 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
247 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
249 return Civi
::$statics[__CLASS__
]['fieldKeys'];
253 * Returns the names of this table
257 public static function getTableName() {
258 return self
::$_tableName;
262 * Returns if this table needs to be logged
266 public function getLog() {
271 * Returns the list of fields that can be imported
273 * @param bool $prefix
277 public static function &import($prefix = FALSE) {
278 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_spool', $prefix, []);
283 * Returns the list of fields that can be exported
285 * @param bool $prefix
289 public static function &export($prefix = FALSE) {
290 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_spool', $prefix, []);
295 * Returns the list of indices
297 * @param bool $localize
301 public static function indices($localize = TRUE) {
303 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;