5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:935e7f9a3718032018ccb082a6c4500c)
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 public static $_tableName = 'civicrm_mailing_component';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 'where' => 'civicrm_mailing_component.id',
105 'table_name' => 'civicrm_mailing_component',
106 'entity' => 'MailingComponent',
107 'bao' => 'CRM_Mailing_BAO_MailingComponent',
112 'type' => CRM_Utils_Type
::T_STRING
,
113 'title' => ts('Component Name'),
114 'description' => ts('The name of this component'),
116 'size' => CRM_Utils_Type
::BIG
,
117 'where' => 'civicrm_mailing_component.name',
118 'table_name' => 'civicrm_mailing_component',
119 'entity' => 'MailingComponent',
120 'bao' => 'CRM_Mailing_BAO_MailingComponent',
123 'component_type' => [
124 'name' => 'component_type',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Mailing Component Type'),
127 'description' => ts('Type of Component.'),
129 'size' => CRM_Utils_Type
::TWELVE
,
130 'where' => 'civicrm_mailing_component.component_type',
131 'table_name' => 'civicrm_mailing_component',
132 'entity' => 'MailingComponent',
133 'bao' => 'CRM_Mailing_BAO_MailingComponent',
138 'pseudoconstant' => [
139 'callback' => 'CRM_Core_SelectValues::mailingComponents',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Subject'),
147 'size' => CRM_Utils_Type
::HUGE
,
148 'where' => 'civicrm_mailing_component.subject',
149 'table_name' => 'civicrm_mailing_component',
150 'entity' => 'MailingComponent',
151 'bao' => 'CRM_Mailing_BAO_MailingComponent',
155 'name' => 'body_html',
156 'type' => CRM_Utils_Type
::T_TEXT
,
157 'title' => ts('Mailing Component Body HTML'),
158 'description' => ts('Body of the component in html format.'),
161 'where' => 'civicrm_mailing_component.body_html',
162 'table_name' => 'civicrm_mailing_component',
163 'entity' => 'MailingComponent',
164 'bao' => 'CRM_Mailing_BAO_MailingComponent',
167 'type' => 'TextArea',
171 'name' => 'body_text',
172 'type' => CRM_Utils_Type
::T_TEXT
,
173 'title' => ts('Body Text'),
174 'description' => ts('Body of the component in text format.'),
177 'where' => 'civicrm_mailing_component.body_text',
178 'table_name' => 'civicrm_mailing_component',
179 'entity' => 'MailingComponent',
180 'bao' => 'CRM_Mailing_BAO_MailingComponent',
183 'type' => 'TextArea',
187 'name' => 'is_default',
188 'type' => CRM_Utils_Type
::T_BOOLEAN
,
189 'title' => ts('Mailing Component is Default?'),
190 'description' => ts('Is this the default component for this component_type?'),
191 'where' => 'civicrm_mailing_component.is_default',
193 'table_name' => 'civicrm_mailing_component',
194 'entity' => 'MailingComponent',
195 'bao' => 'CRM_Mailing_BAO_MailingComponent',
199 'name' => 'is_active',
200 'type' => CRM_Utils_Type
::T_BOOLEAN
,
201 'title' => ts('Mailing Component Is Active?'),
202 'description' => ts('Is this property active?'),
203 'where' => 'civicrm_mailing_component.is_active',
204 'table_name' => 'civicrm_mailing_component',
205 'entity' => 'MailingComponent',
206 'bao' => 'CRM_Mailing_BAO_MailingComponent',
210 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
212 return Civi
::$statics[__CLASS__
]['fields'];
216 * Return a mapping from field-name to the corresponding key (as used in fields()).
219 * Array(string $name => string $uniqueName).
221 public static function &fieldKeys() {
222 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
223 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
225 return Civi
::$statics[__CLASS__
]['fieldKeys'];
229 * Returns the names of this table
233 public static function getTableName() {
234 return self
::$_tableName;
238 * Returns if this table needs to be logged
242 public function getLog() {
247 * Returns the list of fields that can be imported
249 * @param bool $prefix
253 public static function &import($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
259 * Returns the list of fields that can be exported
261 * @param bool $prefix
265 public static function &export($prefix = FALSE) {
266 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
271 * Returns the list of indices
273 * @param bool $localize
277 public static function indices($localize = TRUE) {
279 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;