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