3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Mailing/Component.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:33742feaa53eaba2c4a543c4e5c673ab)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Mailing_DAO_Component constructor.
40 class CRM_Mailing_DAO_Component
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mailing_component';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * The name of this component
69 public $component_type;
76 * Body of the component in html format.
82 * Body of the component in text format.
88 * Is this the default component for this component_type?
94 * Is this property active?
102 function __construct() {
103 $this->__table
= 'civicrm_mailing_component';
104 parent
::__construct();
107 * Returns all the column names of this table
111 static function &fields() {
112 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
113 Civi
::$statics[__CLASS__
]['fields'] = array(
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Mailing Component ID') ,
119 'table_name' => 'civicrm_mailing_component',
120 'entity' => 'Component',
121 'bao' => 'CRM_Mailing_BAO_Component',
126 'type' => CRM_Utils_Type
::T_STRING
,
127 'title' => ts('Component Name') ,
128 'description' => 'The name of this component',
130 'size' => CRM_Utils_Type
::BIG
,
131 'table_name' => 'civicrm_mailing_component',
132 'entity' => 'Component',
133 'bao' => 'CRM_Mailing_BAO_Component',
136 'component_type' => array(
137 'name' => 'component_type',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Mailing Component Type') ,
140 'description' => 'Type of Component.',
142 'size' => CRM_Utils_Type
::TWELVE
,
143 'table_name' => 'civicrm_mailing_component',
144 'entity' => 'Component',
145 'bao' => 'CRM_Mailing_BAO_Component',
150 'pseudoconstant' => array(
151 'callback' => 'CRM_Core_SelectValues::mailingComponents',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Subject') ,
159 'size' => CRM_Utils_Type
::HUGE
,
160 'table_name' => 'civicrm_mailing_component',
161 'entity' => 'Component',
162 'bao' => 'CRM_Mailing_BAO_Component',
165 'body_html' => array(
166 'name' => 'body_html',
167 'type' => CRM_Utils_Type
::T_TEXT
,
168 'title' => ts('Mailing Component Body HTML') ,
169 'description' => 'Body of the component in html format.',
172 'table_name' => 'civicrm_mailing_component',
173 'entity' => 'Component',
174 'bao' => 'CRM_Mailing_BAO_Component',
177 'type' => 'TextArea',
180 'body_text' => array(
181 'name' => 'body_text',
182 'type' => CRM_Utils_Type
::T_TEXT
,
183 'title' => ts('Body Text') ,
184 'description' => 'Body of the component in text format.',
187 'table_name' => 'civicrm_mailing_component',
188 'entity' => 'Component',
189 'bao' => 'CRM_Mailing_BAO_Component',
192 'type' => 'TextArea',
195 'is_default' => array(
196 'name' => 'is_default',
197 'type' => CRM_Utils_Type
::T_BOOLEAN
,
198 'title' => ts('Mailing Component is Default?') ,
199 'description' => 'Is this the default component for this component_type?',
200 'table_name' => 'civicrm_mailing_component',
201 'entity' => 'Component',
202 'bao' => 'CRM_Mailing_BAO_Component',
205 'is_active' => array(
206 'name' => 'is_active',
207 'type' => CRM_Utils_Type
::T_BOOLEAN
,
208 'title' => ts('Mailing Component Is Active?') ,
209 'description' => 'Is this property active?',
210 'table_name' => 'civicrm_mailing_component',
211 'entity' => 'Component',
212 'bao' => 'CRM_Mailing_BAO_Component',
216 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
218 return Civi
::$statics[__CLASS__
]['fields'];
221 * Return a mapping from field-name to the corresponding key (as used in fields()).
224 * Array(string $name => string $uniqueName).
226 static function &fieldKeys() {
227 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
228 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
230 return Civi
::$statics[__CLASS__
]['fieldKeys'];
233 * Returns the names of this table
237 static function getTableName() {
238 return self
::$_tableName;
241 * Returns if this table needs to be logged
249 * Returns the list of fields that can be imported
251 * @param bool $prefix
255 static function &import($prefix = false) {
256 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, array());
260 * Returns the list of fields that can be exported
262 * @param bool $prefix
266 static function &export($prefix = false) {
267 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, array());
271 * Returns the list of indices
273 public static function indices($localize = TRUE) {
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;