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:0f2c6f4aab46e551d1e3ec7fdd55f0f5)
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',
151 'entity_table' => array(
152 'name' => 'entity_table',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Entity Table') ,
155 'description' => 'Name of table where item being referenced is stored.',
158 'size' => CRM_Utils_Type
::BIG
,
159 'table_name' => 'civicrm_tell_friend',
160 'entity' => 'Friend',
161 'bao' => 'CRM_Friend_BAO_Friend',
164 'entity_id' => array(
165 'name' => 'entity_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Entity ID') ,
168 'description' => 'Foreign key to the referenced item.',
170 'table_name' => 'civicrm_tell_friend',
171 'entity' => 'Friend',
172 'bao' => 'CRM_Friend_BAO_Friend',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Title') ,
180 'size' => CRM_Utils_Type
::HUGE
,
181 'table_name' => 'civicrm_tell_friend',
182 'entity' => 'Friend',
183 'bao' => 'CRM_Friend_BAO_Friend',
191 'type' => CRM_Utils_Type
::T_TEXT
,
192 'title' => ts('Intro') ,
193 'description' => 'Introductory message to contributor or participant displayed on the Tell a Friend form.',
194 'table_name' => 'civicrm_tell_friend',
195 'entity' => 'Friend',
196 'bao' => 'CRM_Friend_BAO_Friend',
202 'suggested_message' => array(
203 'name' => 'suggested_message',
204 'type' => CRM_Utils_Type
::T_TEXT
,
205 'title' => ts('Suggested Message') ,
206 'description' => 'Suggested message to friends, provided as default on the Tell A Friend form.',
207 'table_name' => 'civicrm_tell_friend',
208 'entity' => 'Friend',
209 'bao' => 'CRM_Friend_BAO_Friend',
215 'general_link' => array(
216 'name' => 'general_link',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('General Link') ,
219 'description' => 'URL for general info about the organization - included in the email sent to friends.',
221 'size' => CRM_Utils_Type
::HUGE
,
223 'where' => 'civicrm_tell_friend.general_link',
224 'headerPattern' => '',
227 'table_name' => 'civicrm_tell_friend',
228 'entity' => 'Friend',
229 'bao' => 'CRM_Friend_BAO_Friend',
235 'thankyou_title' => array(
236 'name' => 'thankyou_title',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('Thank You Title') ,
239 'description' => 'Text for Tell a Friend thank you page header and HTML title.',
241 'size' => CRM_Utils_Type
::HUGE
,
242 'table_name' => 'civicrm_tell_friend',
243 'entity' => 'Friend',
244 'bao' => 'CRM_Friend_BAO_Friend',
250 'thankyou_text' => array(
251 'name' => 'thankyou_text',
252 'type' => CRM_Utils_Type
::T_TEXT
,
253 'title' => ts('Thank You Text') ,
254 'description' => 'Thank you message displayed on success page.',
255 'table_name' => 'civicrm_tell_friend',
256 'entity' => 'Friend',
257 'bao' => 'CRM_Friend_BAO_Friend',
263 'is_active' => array(
264 'name' => 'is_active',
265 'type' => CRM_Utils_Type
::T_BOOLEAN
,
266 'title' => ts('Enabled?') ,
267 'table_name' => 'civicrm_tell_friend',
268 'entity' => 'Friend',
269 'bao' => 'CRM_Friend_BAO_Friend',
272 'type' => 'CheckBox',
276 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
278 return Civi
::$statics[__CLASS__
]['fields'];
281 * Return a mapping from field-name to the corresponding key (as used in fields()).
284 * Array(string $name => string $uniqueName).
286 static function &fieldKeys() {
287 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
288 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
290 return Civi
::$statics[__CLASS__
]['fieldKeys'];
293 * Returns the names of this table
297 static function getTableName() {
298 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
301 * Returns if this table needs to be logged
309 * Returns the list of fields that can be imported
311 * @param bool $prefix
315 static function &import($prefix = false) {
316 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tell_friend', $prefix, array());
320 * Returns the list of fields that can be exported
322 * @param bool $prefix
326 static function &export($prefix = false) {
327 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tell_friend', $prefix, array());
331 * Returns the list of indices
333 public static function indices($localize = TRUE) {
335 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;