CRM-20312 regenerated DAOS with indexes
[civicrm-core.git] / CRM / Friend / DAO / Friend.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/Friend/Friend.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0f2c6f4aab46e551d1e3ec7fdd55f0f5)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Friend_DAO_Friend constructor.
39 */
40 class CRM_Friend_DAO_Friend extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_tell_friend';
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 * Friend ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Name of table where item being referenced is stored.
61 *
62 * @var string
63 */
64 public $entity_table;
65 /**
66 * Foreign key to the referenced item.
67 *
68 * @var int unsigned
69 */
70 public $entity_id;
71 /**
72 *
73 * @var string
74 */
75 public $title;
76 /**
77 * Introductory message to contributor or participant displayed on the Tell a Friend form.
78 *
79 * @var text
80 */
81 public $intro;
82 /**
83 * Suggested message to friends, provided as default on the Tell A Friend form.
84 *
85 * @var text
86 */
87 public $suggested_message;
88 /**
89 * URL for general info about the organization - included in the email sent to friends.
90 *
91 * @var string
92 */
93 public $general_link;
94 /**
95 * Text for Tell a Friend thank you page header and HTML title.
96 *
97 * @var string
98 */
99 public $thankyou_title;
100 /**
101 * Thank you message displayed on success page.
102 *
103 * @var text
104 */
105 public $thankyou_text;
106 /**
107 *
108 * @var boolean
109 */
110 public $is_active;
111 /**
112 * Class constructor.
113 */
114 function __construct() {
115 $this->__table = 'civicrm_tell_friend';
116 parent::__construct();
117 }
118 /**
119 * Returns foreign keys and entity references.
120 *
121 * @return array
122 * [CRM_Core_Reference_Interface]
123 */
124 static function getReferenceColumns() {
125 if (!isset(Civi::$statics[__CLASS__]['links'])) {
126 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
127 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
128 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
129 }
130 return Civi::$statics[__CLASS__]['links'];
131 }
132 /**
133 * Returns all the column names of this table
134 *
135 * @return array
136 */
137 static function &fields() {
138 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
139 Civi::$statics[__CLASS__]['fields'] = array(
140 'id' => array(
141 'name' => 'id',
142 'type' => CRM_Utils_Type::T_INT,
143 'title' => ts('Friend ID') ,
144 'description' => 'Friend ID',
145 'required' => true,
146 'table_name' => 'civicrm_tell_friend',
147 'entity' => 'Friend',
148 'bao' => 'CRM_Friend_BAO_Friend',
149 'localizable' => 0,
150 ) ,
151 'entity_table' => array(
152 'name' => 'entity_table',
153 'type' => CRM_Utils_Type::T_STRING,
154 'title' => ts('Entity Table') ,
155 'description' => 'Name of table where item being referenced is stored.',
156 'required' => true,
157 'maxlength' => 64,
158 'size' => CRM_Utils_Type::BIG,
159 'table_name' => 'civicrm_tell_friend',
160 'entity' => 'Friend',
161 'bao' => 'CRM_Friend_BAO_Friend',
162 'localizable' => 0,
163 ) ,
164 'entity_id' => array(
165 'name' => 'entity_id',
166 'type' => CRM_Utils_Type::T_INT,
167 'title' => ts('Entity ID') ,
168 'description' => 'Foreign key to the referenced item.',
169 'required' => true,
170 'table_name' => 'civicrm_tell_friend',
171 'entity' => 'Friend',
172 'bao' => 'CRM_Friend_BAO_Friend',
173 'localizable' => 0,
174 ) ,
175 'title' => array(
176 'name' => 'title',
177 'type' => CRM_Utils_Type::T_STRING,
178 'title' => ts('Title') ,
179 'maxlength' => 255,
180 'size' => CRM_Utils_Type::HUGE,
181 'table_name' => 'civicrm_tell_friend',
182 'entity' => 'Friend',
183 'bao' => 'CRM_Friend_BAO_Friend',
184 'localizable' => 1,
185 'html' => array(
186 'type' => 'Text',
187 ) ,
188 ) ,
189 'intro' => array(
190 'name' => 'intro',
191 'type' => CRM_Utils_Type::T_TEXT,
192 'title' => ts('Intro') ,
193 'description' => 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
194 'table_name' => 'civicrm_tell_friend',
195 'entity' => 'Friend',
196 'bao' => 'CRM_Friend_BAO_Friend',
197 'localizable' => 1,
198 'html' => array(
199 'type' => 'Text',
200 ) ,
201 ) ,
202 'suggested_message' => array(
203 'name' => 'suggested_message',
204 'type' => CRM_Utils_Type::T_TEXT,
205 'title' => ts('Suggested Message') ,
206 'description' => 'Suggested message to friends, provided as default on the Tell A Friend form.',
207 'table_name' => 'civicrm_tell_friend',
208 'entity' => 'Friend',
209 'bao' => 'CRM_Friend_BAO_Friend',
210 'localizable' => 1,
211 'html' => array(
212 'type' => 'Text',
213 ) ,
214 ) ,
215 'general_link' => array(
216 'name' => 'general_link',
217 'type' => CRM_Utils_Type::T_STRING,
218 'title' => ts('General Link') ,
219 'description' => 'URL for general info about the organization - included in the email sent to friends.',
220 'maxlength' => 255,
221 'size' => CRM_Utils_Type::HUGE,
222 'import' => true,
223 'where' => 'civicrm_tell_friend.general_link',
224 'headerPattern' => '',
225 'dataPattern' => '',
226 'export' => true,
227 'table_name' => 'civicrm_tell_friend',
228 'entity' => 'Friend',
229 'bao' => 'CRM_Friend_BAO_Friend',
230 'localizable' => 0,
231 'html' => array(
232 'type' => 'Text',
233 ) ,
234 ) ,
235 'thankyou_title' => array(
236 'name' => 'thankyou_title',
237 'type' => CRM_Utils_Type::T_STRING,
238 'title' => ts('Thank You Title') ,
239 'description' => 'Text for Tell a Friend thank you page header and HTML title.',
240 'maxlength' => 255,
241 'size' => CRM_Utils_Type::HUGE,
242 'table_name' => 'civicrm_tell_friend',
243 'entity' => 'Friend',
244 'bao' => 'CRM_Friend_BAO_Friend',
245 'localizable' => 1,
246 'html' => array(
247 'type' => 'Text',
248 ) ,
249 ) ,
250 'thankyou_text' => array(
251 'name' => 'thankyou_text',
252 'type' => CRM_Utils_Type::T_TEXT,
253 'title' => ts('Thank You Text') ,
254 'description' => 'Thank you message displayed on success page.',
255 'table_name' => 'civicrm_tell_friend',
256 'entity' => 'Friend',
257 'bao' => 'CRM_Friend_BAO_Friend',
258 'localizable' => 1,
259 'html' => array(
260 'type' => 'Text',
261 ) ,
262 ) ,
263 'is_active' => array(
264 'name' => 'is_active',
265 'type' => CRM_Utils_Type::T_BOOLEAN,
266 'title' => ts('Enabled?') ,
267 'table_name' => 'civicrm_tell_friend',
268 'entity' => 'Friend',
269 'bao' => 'CRM_Friend_BAO_Friend',
270 'localizable' => 0,
271 'html' => array(
272 'type' => 'CheckBox',
273 ) ,
274 ) ,
275 );
276 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
277 }
278 return Civi::$statics[__CLASS__]['fields'];
279 }
280 /**
281 * Return a mapping from field-name to the corresponding key (as used in fields()).
282 *
283 * @return array
284 * Array(string $name => string $uniqueName).
285 */
286 static function &fieldKeys() {
287 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
288 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
289 }
290 return Civi::$statics[__CLASS__]['fieldKeys'];
291 }
292 /**
293 * Returns the names of this table
294 *
295 * @return string
296 */
297 static function getTableName() {
298 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
299 }
300 /**
301 * Returns if this table needs to be logged
302 *
303 * @return boolean
304 */
305 function getLog() {
306 return self::$_log;
307 }
308 /**
309 * Returns the list of fields that can be imported
310 *
311 * @param bool $prefix
312 *
313 * @return array
314 */
315 static function &import($prefix = false) {
316 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'tell_friend', $prefix, array());
317 return $r;
318 }
319 /**
320 * Returns the list of fields that can be exported
321 *
322 * @param bool $prefix
323 *
324 * @return array
325 */
326 static function &export($prefix = false) {
327 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'tell_friend', $prefix, array());
328 return $r;
329 }
330 /**
331 * Returns the list of indices
332 */
333 public static function indices($localize = TRUE) {
334 $indices = array();
335 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
336 }
337 }