3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Friend/Friend.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:f43aa2600521ff0d7c499e9d432dfe8f)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Friend_DAO_Friend constructor.
40 class CRM_Friend_DAO_Friend
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_tell_friend';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Name of table where item being referenced is stored.
66 * Foreign key to the referenced item.
77 * Introductory message to contributor or participant displayed on the Tell a Friend form.
83 * Suggested message to friends, provided as default on the Tell A Friend form.
87 public $suggested_message;
89 * URL for general info about the organization - included in the email sent to friends.
95 * Text for Tell a Friend thank you page header and HTML title.
99 public $thankyou_title;
101 * Thank you message displayed on success page.
105 public $thankyou_text;
114 function __construct() {
115 $this->__table
= 'civicrm_tell_friend';
116 parent
::__construct();
119 * Returns foreign keys and entity references.
122 * [CRM_Core_Reference_Interface]
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']);
130 return Civi
::$statics[__CLASS__
]['links'];
133 * Returns all the column names of this table
137 static function &fields() {
138 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
139 Civi
::$statics[__CLASS__
]['fields'] = array(
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Friend ID') ,
144 'description' => 'Friend ID',
146 'table_name' => 'civicrm_tell_friend',
147 'entity' => 'Friend',
148 'bao' => 'CRM_Friend_BAO_Friend',
150 'entity_table' => array(
151 'name' => 'entity_table',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Entity Table') ,
154 'description' => 'Name of table where item being referenced is stored.',
157 'size' => CRM_Utils_Type
::BIG
,
158 'table_name' => 'civicrm_tell_friend',
159 'entity' => 'Friend',
160 'bao' => 'CRM_Friend_BAO_Friend',
162 'entity_id' => array(
163 'name' => 'entity_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Entity ID') ,
166 'description' => 'Foreign key to the referenced item.',
168 'table_name' => 'civicrm_tell_friend',
169 'entity' => 'Friend',
170 'bao' => 'CRM_Friend_BAO_Friend',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Title') ,
177 'size' => CRM_Utils_Type
::HUGE
,
178 'table_name' => 'civicrm_tell_friend',
179 'entity' => 'Friend',
180 'bao' => 'CRM_Friend_BAO_Friend',
187 'type' => CRM_Utils_Type
::T_TEXT
,
188 'title' => ts('Intro') ,
189 'description' => 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
190 'table_name' => 'civicrm_tell_friend',
191 'entity' => 'Friend',
192 'bao' => 'CRM_Friend_BAO_Friend',
197 'suggested_message' => array(
198 'name' => 'suggested_message',
199 'type' => CRM_Utils_Type
::T_TEXT
,
200 'title' => ts('Suggested Message') ,
201 'description' => 'Suggested message to friends, provided as default on the Tell A Friend form.',
202 'table_name' => 'civicrm_tell_friend',
203 'entity' => 'Friend',
204 'bao' => 'CRM_Friend_BAO_Friend',
209 'general_link' => array(
210 'name' => 'general_link',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('General Link') ,
213 'description' => 'URL for general info about the organization - included in the email sent to friends.',
215 'size' => CRM_Utils_Type
::HUGE
,
217 'where' => 'civicrm_tell_friend.general_link',
218 'headerPattern' => '',
221 'table_name' => 'civicrm_tell_friend',
222 'entity' => 'Friend',
223 'bao' => 'CRM_Friend_BAO_Friend',
228 'thankyou_title' => array(
229 'name' => 'thankyou_title',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Thank You Title') ,
232 'description' => 'Text for Tell a Friend thank you page header and HTML title.',
234 'size' => CRM_Utils_Type
::HUGE
,
235 'table_name' => 'civicrm_tell_friend',
236 'entity' => 'Friend',
237 'bao' => 'CRM_Friend_BAO_Friend',
242 'thankyou_text' => array(
243 'name' => 'thankyou_text',
244 'type' => CRM_Utils_Type
::T_TEXT
,
245 'title' => ts('Thank You Text') ,
246 'description' => 'Thank you message displayed on success page.',
247 'table_name' => 'civicrm_tell_friend',
248 'entity' => 'Friend',
249 'bao' => 'CRM_Friend_BAO_Friend',
254 'is_active' => array(
255 'name' => 'is_active',
256 'type' => CRM_Utils_Type
::T_BOOLEAN
,
257 'title' => ts('Enabled?') ,
258 'table_name' => 'civicrm_tell_friend',
259 'entity' => 'Friend',
260 'bao' => 'CRM_Friend_BAO_Friend',
262 'type' => 'CheckBox',
266 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
268 return Civi
::$statics[__CLASS__
]['fields'];
271 * Return a mapping from field-name to the corresponding key (as used in fields()).
274 * Array(string $name => string $uniqueName).
276 static function &fieldKeys() {
277 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
278 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
280 return Civi
::$statics[__CLASS__
]['fieldKeys'];
283 * Returns the names of this table
287 static function getTableName() {
288 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
291 * Returns if this table needs to be logged
299 * Returns the list of fields that can be imported
301 * @param bool $prefix
305 static function &import($prefix = false) {
306 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tell_friend', $prefix, array());
310 * Returns the list of fields that can be exported
312 * @param bool $prefix
316 static function &export($prefix = false) {
317 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tell_friend', $prefix, array());