commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Friend / DAO / Friend.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
30 *
31 * Generated from xml/schema/CRM/Friend/Friend.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Friend_DAO_Friend extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_tell_friend';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = false;
82 /**
83 * Friend ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Name of table where item being referenced is stored.
90 *
91 * @var string
92 */
93 public $entity_table;
94 /**
95 * Foreign key to the referenced item.
96 *
97 * @var int unsigned
98 */
99 public $entity_id;
100 /**
101 *
102 * @var string
103 */
104 public $title;
105 /**
106 * Introductory message to contributor or participant displayed on the Tell a Friend form.
107 *
108 * @var text
109 */
110 public $intro;
111 /**
112 * Suggested message to friends, provided as default on the Tell A Friend form.
113 *
114 * @var text
115 */
116 public $suggested_message;
117 /**
118 * URL for general info about the organization - included in the email sent to friends.
119 *
120 * @var string
121 */
122 public $general_link;
123 /**
124 * Text for Tell a Friend thank you page header and HTML title.
125 *
126 * @var string
127 */
128 public $thankyou_title;
129 /**
130 * Thank you message displayed on success page.
131 *
132 * @var text
133 */
134 public $thankyou_text;
135 /**
136 *
137 * @var boolean
138 */
139 public $is_active;
140 /**
141 * class constructor
142 *
143 * @return civicrm_tell_friend
144 */
145 function __construct() {
146 $this->__table = 'civicrm_tell_friend';
147 parent::__construct();
148 }
149 /**
150 * Returns foreign keys and entity references
151 *
152 * @return array
153 * [CRM_Core_Reference_Interface]
154 */
155 static function getReferenceColumns() {
156 if (!self::$_links) {
157 self::$_links = static ::createReferenceColumns(__CLASS__);
158 self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
159 }
160 return self::$_links;
161 }
162 /**
163 * Returns all the column names of this table
164 *
165 * @return array
166 */
167 static function &fields() {
168 if (!(self::$_fields)) {
169 self::$_fields = array(
170 'id' => array(
171 'name' => 'id',
172 'type' => CRM_Utils_Type::T_INT,
173 'description' => 'Friend ID',
174 'required' => true,
175 ) ,
176 'entity_table' => array(
177 'name' => 'entity_table',
178 'type' => CRM_Utils_Type::T_STRING,
179 'title' => ts('Entity Table') ,
180 'description' => 'Name of table where item being referenced is stored.',
181 'required' => true,
182 'maxlength' => 64,
183 'size' => CRM_Utils_Type::BIG,
184 ) ,
185 'entity_id' => array(
186 'name' => 'entity_id',
187 'type' => CRM_Utils_Type::T_INT,
188 'description' => 'Foreign key to the referenced item.',
189 'required' => true,
190 ) ,
191 'title' => array(
192 'name' => 'title',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Title') ,
195 'maxlength' => 255,
196 'size' => CRM_Utils_Type::HUGE,
197 'html' => array(
198 'type' => 'Text',
199 ) ,
200 ) ,
201 'intro' => array(
202 'name' => 'intro',
203 'type' => CRM_Utils_Type::T_TEXT,
204 'title' => ts('Intro') ,
205 'description' => 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
206 'html' => array(
207 'type' => 'Text',
208 ) ,
209 ) ,
210 'suggested_message' => array(
211 'name' => 'suggested_message',
212 'type' => CRM_Utils_Type::T_TEXT,
213 'title' => ts('Suggested Message') ,
214 'description' => 'Suggested message to friends, provided as default on the Tell A Friend form.',
215 'html' => array(
216 'type' => 'Text',
217 ) ,
218 ) ,
219 'general_link' => array(
220 'name' => 'general_link',
221 'type' => CRM_Utils_Type::T_STRING,
222 'title' => ts('General Link') ,
223 'description' => 'URL for general info about the organization - included in the email sent to friends.',
224 'maxlength' => 255,
225 'size' => CRM_Utils_Type::HUGE,
226 'import' => true,
227 'where' => 'civicrm_tell_friend.general_link',
228 'headerPattern' => '',
229 'dataPattern' => '',
230 'export' => true,
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('Thankyou 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 'html' => array(
243 'type' => 'Text',
244 ) ,
245 ) ,
246 'thankyou_text' => array(
247 'name' => 'thankyou_text',
248 'type' => CRM_Utils_Type::T_TEXT,
249 'title' => ts('Thankyou Text') ,
250 'description' => 'Thank you message displayed on success page.',
251 'html' => array(
252 'type' => 'Text',
253 ) ,
254 ) ,
255 'is_active' => array(
256 'name' => 'is_active',
257 'type' => CRM_Utils_Type::T_BOOLEAN,
258 'html' => array(
259 'type' => 'CheckBox',
260 ) ,
261 ) ,
262 );
263 }
264 return self::$_fields;
265 }
266 /**
267 * Returns an array containing, for each field, the arary key used for that
268 * field in self::$_fields.
269 *
270 * @return array
271 */
272 static function &fieldKeys() {
273 if (!(self::$_fieldKeys)) {
274 self::$_fieldKeys = array(
275 'id' => 'id',
276 'entity_table' => 'entity_table',
277 'entity_id' => 'entity_id',
278 'title' => 'title',
279 'intro' => 'intro',
280 'suggested_message' => 'suggested_message',
281 'general_link' => 'general_link',
282 'thankyou_title' => 'thankyou_title',
283 'thankyou_text' => 'thankyou_text',
284 'is_active' => 'is_active',
285 );
286 }
287 return self::$_fieldKeys;
288 }
289 /**
290 * Returns the names of this table
291 *
292 * @return string
293 */
294 static function getTableName() {
295 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
296 }
297 /**
298 * Returns if this table needs to be logged
299 *
300 * @return boolean
301 */
302 function getLog() {
303 return self::$_log;
304 }
305 /**
306 * Returns the list of fields that can be imported
307 *
308 * @param bool $prefix
309 *
310 * @return array
311 */
312 static function &import($prefix = false) {
313 if (!(self::$_import)) {
314 self::$_import = array();
315 $fields = self::fields();
316 foreach($fields as $name => $field) {
317 if (CRM_Utils_Array::value('import', $field)) {
318 if ($prefix) {
319 self::$_import['tell_friend'] = & $fields[$name];
320 } else {
321 self::$_import[$name] = & $fields[$name];
322 }
323 }
324 }
325 }
326 return self::$_import;
327 }
328 /**
329 * Returns the list of fields that can be exported
330 *
331 * @param bool $prefix
332 *
333 * @return array
334 */
335 static function &export($prefix = false) {
336 if (!(self::$_export)) {
337 self::$_export = array();
338 $fields = self::fields();
339 foreach($fields as $name => $field) {
340 if (CRM_Utils_Array::value('export', $field)) {
341 if ($prefix) {
342 self::$_export['tell_friend'] = & $fields[$name];
343 } else {
344 self::$_export[$name] = & $fields[$name];
345 }
346 }
347 }
348 }
349 return self::$_export;
350 }
351 }