3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Friend/Friend.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Friend_DAO_Friend
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_tell_friend';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * Name of table where item being referenced is stored.
95 * Foreign key to the referenced item.
106 * Introductory message to contributor or participant displayed on the Tell a Friend form.
112 * Suggested message to friends, provided as default on the Tell A Friend form.
116 public $suggested_message;
118 * URL for general info about the organization - included in the email sent to friends.
122 public $general_link;
124 * Text for Tell a Friend thank you page header and HTML title.
128 public $thankyou_title;
130 * Thank you message displayed on success page.
134 public $thankyou_text;
143 * @return civicrm_tell_friend
145 function __construct() {
146 $this->__table
= 'civicrm_tell_friend';
147 parent
::__construct();
150 * Returns foreign keys and entity references
153 * [CRM_Core_Reference_Interface]
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');
160 return self
::$_links;
163 * Returns all the column names of this table
167 static function &fields() {
168 if (!(self
::$_fields)) {
169 self
::$_fields = array(
172 'type' => CRM_Utils_Type
::T_INT
,
173 'description' => 'Friend ID',
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.',
183 'size' => CRM_Utils_Type
::BIG
,
185 'entity_id' => array(
186 'name' => 'entity_id',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'description' => 'Foreign key to the referenced item.',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Title') ,
196 'size' => CRM_Utils_Type
::HUGE
,
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.',
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.',
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.',
225 'size' => CRM_Utils_Type
::HUGE
,
227 'where' => 'civicrm_tell_friend.general_link',
228 'headerPattern' => '',
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.',
241 'size' => CRM_Utils_Type
::HUGE
,
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.',
255 'is_active' => array(
256 'name' => 'is_active',
257 'type' => CRM_Utils_Type
::T_BOOLEAN
,
259 'type' => 'CheckBox',
264 return self
::$_fields;
267 * Returns an array containing, for each field, the arary key used for that
268 * field in self::$_fields.
272 static function &fieldKeys() {
273 if (!(self
::$_fieldKeys)) {
274 self
::$_fieldKeys = array(
276 'entity_table' => 'entity_table',
277 'entity_id' => 'entity_id',
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',
287 return self
::$_fieldKeys;
290 * Returns the names of this table
294 static function getTableName() {
295 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
298 * Returns if this table needs to be logged
306 * Returns the list of fields that can be imported
308 * @param bool $prefix
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)) {
319 self
::$_import['tell_friend'] = & $fields[$name];
321 self
::$_import[$name] = & $fields[$name];
326 return self
::$_import;
329 * Returns the list of fields that can be exported
331 * @param bool $prefix
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)) {
342 self
::$_export['tell_friend'] = & $fields[$name];
344 self
::$_export[$name] = & $fields[$name];
349 return self
::$_export;