Merge pull request #9616 from ErichBSchulz/feature/drupal_boot_no_exit
[civicrm-core.git] / CRM / Mailing / DAO / Component.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Mailing/Component.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:33742feaa53eaba2c4a543c4e5c673ab)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Mailing_DAO_Component constructor.
39 */
40 class CRM_Mailing_DAO_Component extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_mailing_component';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * The name of this component
60 *
61 * @var string
62 */
63 public $name;
64 /**
65 * Type of Component.
66 *
67 * @var string
68 */
69 public $component_type;
70 /**
71 *
72 * @var string
73 */
74 public $subject;
75 /**
76 * Body of the component in html format.
77 *
78 * @var text
79 */
80 public $body_html;
81 /**
82 * Body of the component in text format.
83 *
84 * @var text
85 */
86 public $body_text;
87 /**
88 * Is this the default component for this component_type?
89 *
90 * @var boolean
91 */
92 public $is_default;
93 /**
94 * Is this property active?
95 *
96 * @var boolean
97 */
98 public $is_active;
99 /**
100 * Class constructor.
101 */
102 function __construct() {
103 $this->__table = 'civicrm_mailing_component';
104 parent::__construct();
105 }
106 /**
107 * Returns all the column names of this table
108 *
109 * @return array
110 */
111 static function &fields() {
112 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
113 Civi::$statics[__CLASS__]['fields'] = array(
114 'id' => array(
115 'name' => 'id',
116 'type' => CRM_Utils_Type::T_INT,
117 'title' => ts('Mailing Component ID') ,
118 'required' => true,
119 'table_name' => 'civicrm_mailing_component',
120 'entity' => 'Component',
121 'bao' => 'CRM_Mailing_BAO_Component',
122 ) ,
123 'name' => array(
124 'name' => 'name',
125 'type' => CRM_Utils_Type::T_STRING,
126 'title' => ts('Component Name') ,
127 'description' => 'The name of this component',
128 'maxlength' => 64,
129 'size' => CRM_Utils_Type::BIG,
130 'table_name' => 'civicrm_mailing_component',
131 'entity' => 'Component',
132 'bao' => 'CRM_Mailing_BAO_Component',
133 ) ,
134 'component_type' => array(
135 'name' => 'component_type',
136 'type' => CRM_Utils_Type::T_STRING,
137 'title' => ts('Mailing Component Type') ,
138 'description' => 'Type of Component.',
139 'maxlength' => 12,
140 'size' => CRM_Utils_Type::TWELVE,
141 'table_name' => 'civicrm_mailing_component',
142 'entity' => 'Component',
143 'bao' => 'CRM_Mailing_BAO_Component',
144 'html' => array(
145 'type' => 'Select',
146 ) ,
147 'pseudoconstant' => array(
148 'callback' => 'CRM_Core_SelectValues::mailingComponents',
149 )
150 ) ,
151 'subject' => array(
152 'name' => 'subject',
153 'type' => CRM_Utils_Type::T_STRING,
154 'title' => ts('Subject') ,
155 'maxlength' => 255,
156 'size' => CRM_Utils_Type::HUGE,
157 'table_name' => 'civicrm_mailing_component',
158 'entity' => 'Component',
159 'bao' => 'CRM_Mailing_BAO_Component',
160 ) ,
161 'body_html' => array(
162 'name' => 'body_html',
163 'type' => CRM_Utils_Type::T_TEXT,
164 'title' => ts('Mailing Component Body HTML') ,
165 'description' => 'Body of the component in html format.',
166 'rows' => 8,
167 'cols' => 80,
168 'table_name' => 'civicrm_mailing_component',
169 'entity' => 'Component',
170 'bao' => 'CRM_Mailing_BAO_Component',
171 'html' => array(
172 'type' => 'TextArea',
173 ) ,
174 ) ,
175 'body_text' => array(
176 'name' => 'body_text',
177 'type' => CRM_Utils_Type::T_TEXT,
178 'title' => ts('Body Text') ,
179 'description' => 'Body of the component in text format.',
180 'rows' => 8,
181 'cols' => 80,
182 'table_name' => 'civicrm_mailing_component',
183 'entity' => 'Component',
184 'bao' => 'CRM_Mailing_BAO_Component',
185 'html' => array(
186 'type' => 'TextArea',
187 ) ,
188 ) ,
189 'is_default' => array(
190 'name' => 'is_default',
191 'type' => CRM_Utils_Type::T_BOOLEAN,
192 'title' => ts('Mailing Component is Default?') ,
193 'description' => 'Is this the default component for this component_type?',
194 'table_name' => 'civicrm_mailing_component',
195 'entity' => 'Component',
196 'bao' => 'CRM_Mailing_BAO_Component',
197 ) ,
198 'is_active' => array(
199 'name' => 'is_active',
200 'type' => CRM_Utils_Type::T_BOOLEAN,
201 'title' => ts('Mailing Component Is Active?') ,
202 'description' => 'Is this property active?',
203 'table_name' => 'civicrm_mailing_component',
204 'entity' => 'Component',
205 'bao' => 'CRM_Mailing_BAO_Component',
206 ) ,
207 );
208 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
209 }
210 return Civi::$statics[__CLASS__]['fields'];
211 }
212 /**
213 * Return a mapping from field-name to the corresponding key (as used in fields()).
214 *
215 * @return array
216 * Array(string $name => string $uniqueName).
217 */
218 static function &fieldKeys() {
219 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
220 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
221 }
222 return Civi::$statics[__CLASS__]['fieldKeys'];
223 }
224 /**
225 * Returns the names of this table
226 *
227 * @return string
228 */
229 static function getTableName() {
230 return self::$_tableName;
231 }
232 /**
233 * Returns if this table needs to be logged
234 *
235 * @return boolean
236 */
237 function getLog() {
238 return self::$_log;
239 }
240 /**
241 * Returns the list of fields that can be imported
242 *
243 * @param bool $prefix
244 *
245 * @return array
246 */
247 static function &import($prefix = false) {
248 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_component', $prefix, array());
249 return $r;
250 }
251 /**
252 * Returns the list of fields that can be exported
253 *
254 * @param bool $prefix
255 *
256 * @return array
257 */
258 static function &export($prefix = false) {
259 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_component', $prefix, array());
260 return $r;
261 }
262 }