3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Friend/Friend.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a4644e3a31c87da3c038fb840579e48b)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Friend_DAO_Friend
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_tell_friend';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Name of table where item being referenced is stored.
96 * Foreign key to the referenced item.
107 * Introductory message to contributor or participant displayed on the Tell a Friend form.
113 * Suggested message to friends, provided as default on the Tell A Friend form.
117 public $suggested_message;
119 * URL for general info about the organization - included in the email sent to friends.
123 public $general_link;
125 * Text for Tell a Friend thank you page header and HTML title.
129 public $thankyou_title;
131 * Thank you message displayed on success page.
135 public $thankyou_text;
144 * @return civicrm_tell_friend
146 function __construct() {
147 $this->__table
= 'civicrm_tell_friend';
148 parent
::__construct();
151 * Returns foreign keys and entity references
154 * [CRM_Core_Reference_Interface]
156 static function getReferenceColumns() {
157 if (!self
::$_links) {
158 self
::$_links = static ::createReferenceColumns(__CLASS__
);
159 self
::$_links[] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
161 return self
::$_links;
164 * Returns all the column names of this table
168 static function &fields() {
169 if (!(self
::$_fields)) {
170 self
::$_fields = array(
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Friend ID') ,
175 'description' => 'Friend ID',
178 'entity_table' => array(
179 'name' => 'entity_table',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('Entity Table') ,
182 'description' => 'Name of table where item being referenced is stored.',
185 'size' => CRM_Utils_Type
::BIG
,
187 'entity_id' => array(
188 'name' => 'entity_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Entity ID') ,
191 'description' => 'Foreign key to the referenced item.',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Title') ,
199 'size' => CRM_Utils_Type
::HUGE
,
206 'type' => CRM_Utils_Type
::T_TEXT
,
207 'title' => ts('Intro') ,
208 'description' => 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
213 'suggested_message' => array(
214 'name' => 'suggested_message',
215 'type' => CRM_Utils_Type
::T_TEXT
,
216 'title' => ts('Suggested Message') ,
217 'description' => 'Suggested message to friends, provided as default on the Tell A Friend form.',
222 'general_link' => array(
223 'name' => 'general_link',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('General Link') ,
226 'description' => 'URL for general info about the organization - included in the email sent to friends.',
228 'size' => CRM_Utils_Type
::HUGE
,
230 'where' => 'civicrm_tell_friend.general_link',
231 'headerPattern' => '',
238 'thankyou_title' => array(
239 'name' => 'thankyou_title',
240 'type' => CRM_Utils_Type
::T_STRING
,
241 'title' => ts('Thank You Title') ,
242 'description' => 'Text for Tell a Friend thank you page header and HTML title.',
244 'size' => CRM_Utils_Type
::HUGE
,
249 'thankyou_text' => array(
250 'name' => 'thankyou_text',
251 'type' => CRM_Utils_Type
::T_TEXT
,
252 'title' => ts('Thank You Text') ,
253 'description' => 'Thank you message displayed on success page.',
258 'is_active' => array(
259 'name' => 'is_active',
260 'type' => CRM_Utils_Type
::T_BOOLEAN
,
261 'title' => ts('Enabled?') ,
263 'type' => 'CheckBox',
268 return self
::$_fields;
271 * Returns an array containing, for each field, the arary key used for that
272 * field in self::$_fields.
276 static function &fieldKeys() {
277 if (!(self
::$_fieldKeys)) {
278 self
::$_fieldKeys = array(
280 'entity_table' => 'entity_table',
281 'entity_id' => 'entity_id',
284 'suggested_message' => 'suggested_message',
285 'general_link' => 'general_link',
286 'thankyou_title' => 'thankyou_title',
287 'thankyou_text' => 'thankyou_text',
288 'is_active' => 'is_active',
291 return self
::$_fieldKeys;
294 * Returns the names of this table
298 static function getTableName() {
299 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
302 * Returns if this table needs to be logged
310 * Returns the list of fields that can be imported
312 * @param bool $prefix
316 static function &import($prefix = false) {
317 if (!(self
::$_import)) {
318 self
::$_import = array();
319 $fields = self
::fields();
320 foreach($fields as $name => $field) {
321 if (CRM_Utils_Array
::value('import', $field)) {
323 self
::$_import['tell_friend'] = & $fields[$name];
325 self
::$_import[$name] = & $fields[$name];
330 return self
::$_import;
333 * Returns the list of fields that can be exported
335 * @param bool $prefix
339 static function &export($prefix = false) {
340 if (!(self
::$_export)) {
341 self
::$_export = array();
342 $fields = self
::fields();
343 foreach($fields as $name => $field) {
344 if (CRM_Utils_Array
::value('export', $field)) {
346 self
::$_export['tell_friend'] = & $fields[$name];
348 self
::$_export[$name] = & $fields[$name];
353 return self
::$_export;