5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Component.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:33742feaa53eaba2c4a543c4e5c673ab)
13 * Database access object for the Component entity.
15 class CRM_Mailing_DAO_Component
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' => 'Component',
106 'bao' => 'CRM_Mailing_BAO_Component',
111 'type' => CRM_Utils_Type
::T_STRING
,
112 'title' => ts('Component Name'),
113 'description' => 'The name of this component',
115 'size' => CRM_Utils_Type
::BIG
,
116 'table_name' => 'civicrm_mailing_component',
117 'entity' => 'Component',
118 'bao' => 'CRM_Mailing_BAO_Component',
121 'component_type' => [
122 'name' => 'component_type',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Mailing Component Type'),
125 'description' => 'Type of Component.',
127 'size' => CRM_Utils_Type
::TWELVE
,
128 'table_name' => 'civicrm_mailing_component',
129 'entity' => 'Component',
130 'bao' => 'CRM_Mailing_BAO_Component',
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' => 'Component',
147 'bao' => 'CRM_Mailing_BAO_Component',
151 'name' => 'body_html',
152 'type' => CRM_Utils_Type
::T_TEXT
,
153 'title' => ts('Mailing Component Body HTML'),
154 'description' => 'Body of the component in html format.',
157 'table_name' => 'civicrm_mailing_component',
158 'entity' => 'Component',
159 'bao' => 'CRM_Mailing_BAO_Component',
162 'type' => 'TextArea',
166 'name' => 'body_text',
167 'type' => CRM_Utils_Type
::T_TEXT
,
168 'title' => ts('Body Text'),
169 'description' => 'Body of the component in text format.',
172 'table_name' => 'civicrm_mailing_component',
173 'entity' => 'Component',
174 'bao' => 'CRM_Mailing_BAO_Component',
177 'type' => 'TextArea',
181 'name' => 'is_default',
182 'type' => CRM_Utils_Type
::T_BOOLEAN
,
183 'title' => ts('Mailing Component is Default?'),
184 'description' => 'Is this the default component for this component_type?',
185 'table_name' => 'civicrm_mailing_component',
186 'entity' => 'Component',
187 'bao' => 'CRM_Mailing_BAO_Component',
191 'name' => 'is_active',
192 'type' => CRM_Utils_Type
::T_BOOLEAN
,
193 'title' => ts('Mailing Component Is Active?'),
194 'description' => 'Is this property active?',
195 'table_name' => 'civicrm_mailing_component',
196 'entity' => 'Component',
197 'bao' => 'CRM_Mailing_BAO_Component',
201 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
203 return Civi
::$statics[__CLASS__
]['fields'];
207 * Return a mapping from field-name to the corresponding key (as used in fields()).
210 * Array(string $name => string $uniqueName).
212 public static function &fieldKeys() {
213 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
214 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
216 return Civi
::$statics[__CLASS__
]['fieldKeys'];
220 * Returns the names of this table
224 public static function getTableName() {
225 return self
::$_tableName;
229 * Returns if this table needs to be logged
233 public function getLog() {
238 * Returns the list of fields that can be imported
240 * @param bool $prefix
244 public static function &import($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
250 * Returns the list of fields that can be exported
252 * @param bool $prefix
256 public static function &export($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
262 * Returns the list of indices
264 * @param bool $localize
268 public static function indices($localize = TRUE) {
270 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;