5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:23d25f6c575ca92ad96398dac2a27239)
13 * Database access object for the MailingComponent entity.
15 class CRM_Mailing_DAO_MailingComponent
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_mailing_component';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
37 * The name of this component
48 public $component_type;
56 * Body of the component in html format.
63 * Body of the component in text format.
70 * Is this the default component for this component_type?
77 * Is this property active?
86 public function __construct() {
87 $this->__table
= 'civicrm_mailing_component';
88 parent
::__construct();
92 * Returns all the column names of this table
96 public static function &fields() {
97 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
98 Civi
::$statics[__CLASS__
]['fields'] = [
101 'type' => CRM_Utils_Type
::T_INT
,
102 'title' => ts('Mailing Component ID'),
104 'table_name' => 'civicrm_mailing_component',
105 'entity' => 'MailingComponent',
106 'bao' => 'CRM_Mailing_BAO_MailingComponent',
111 'type' => CRM_Utils_Type
::T_STRING
,
112 'title' => ts('Component Name'),
113 'description' => ts('The name of this component'),
115 'size' => CRM_Utils_Type
::BIG
,
116 'table_name' => 'civicrm_mailing_component',
117 'entity' => 'MailingComponent',
118 'bao' => 'CRM_Mailing_BAO_MailingComponent',
121 'component_type' => [
122 'name' => 'component_type',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Mailing Component Type'),
125 'description' => ts('Type of Component.'),
127 'size' => CRM_Utils_Type
::TWELVE
,
128 'table_name' => 'civicrm_mailing_component',
129 'entity' => 'MailingComponent',
130 'bao' => 'CRM_Mailing_BAO_MailingComponent',
135 'pseudoconstant' => [
136 'callback' => 'CRM_Core_SelectValues::mailingComponents',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Subject'),
144 'size' => CRM_Utils_Type
::HUGE
,
145 'table_name' => 'civicrm_mailing_component',
146 'entity' => 'MailingComponent',
147 'bao' => 'CRM_Mailing_BAO_MailingComponent',
151 'name' => 'body_html',
152 'type' => CRM_Utils_Type
::T_TEXT
,
153 'title' => ts('Mailing Component Body HTML'),
154 'description' => ts('Body of the component in html format.'),
157 'table_name' => 'civicrm_mailing_component',
158 'entity' => 'MailingComponent',
159 'bao' => 'CRM_Mailing_BAO_MailingComponent',
162 'type' => 'TextArea',
166 'name' => 'body_text',
167 'type' => CRM_Utils_Type
::T_TEXT
,
168 'title' => ts('Body Text'),
169 'description' => ts('Body of the component in text format.'),
172 'table_name' => 'civicrm_mailing_component',
173 'entity' => 'MailingComponent',
174 'bao' => 'CRM_Mailing_BAO_MailingComponent',
177 'type' => 'TextArea',
181 'name' => 'is_default',
182 'type' => CRM_Utils_Type
::T_BOOLEAN
,
183 'title' => ts('Mailing Component is Default?'),
184 'description' => ts('Is this the default component for this component_type?'),
186 'table_name' => 'civicrm_mailing_component',
187 'entity' => 'MailingComponent',
188 'bao' => 'CRM_Mailing_BAO_MailingComponent',
192 'name' => 'is_active',
193 'type' => CRM_Utils_Type
::T_BOOLEAN
,
194 'title' => ts('Mailing Component Is Active?'),
195 'description' => ts('Is this property active?'),
196 'table_name' => 'civicrm_mailing_component',
197 'entity' => 'MailingComponent',
198 'bao' => 'CRM_Mailing_BAO_MailingComponent',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
271 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;