5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Friend/Friend.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:8218c3da1a68f90b534e4724bd0b89b1)
13 * Database access object for the Friend entity.
15 class CRM_Friend_DAO_Friend
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_tell_friend';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Name of table where item being referenced is stored.
46 * Foreign key to the referenced item.
58 * Introductory message to contributor or participant displayed on the Tell a Friend form.
65 * Suggested message to friends, provided as default on the Tell A Friend form.
69 public $suggested_message;
72 * URL for general info about the organization - included in the email sent to friends.
79 * Text for Tell a Friend thank you page header and HTML title.
83 public $thankyou_title;
86 * Thank you message displayed on success page.
90 public $thankyou_text;
100 public function __construct() {
101 $this->__table
= 'civicrm_tell_friend';
102 parent
::__construct();
106 * Returns foreign keys and entity references.
109 * [CRM_Core_Reference_Interface]
111 public static function getReferenceColumns() {
112 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
113 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
114 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
115 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
117 return Civi
::$statics[__CLASS__
]['links'];
121 * Returns all the column names of this table
125 public static function &fields() {
126 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
127 Civi
::$statics[__CLASS__
]['fields'] = [
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Friend ID'),
132 'description' => ts('Friend ID'),
134 'where' => 'civicrm_tell_friend.id',
135 'table_name' => 'civicrm_tell_friend',
136 'entity' => 'Friend',
137 'bao' => 'CRM_Friend_BAO_Friend',
141 'name' => 'entity_table',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Entity Table'),
144 'description' => ts('Name of table where item being referenced is stored.'),
147 'size' => CRM_Utils_Type
::BIG
,
148 'where' => 'civicrm_tell_friend.entity_table',
149 'table_name' => 'civicrm_tell_friend',
150 'entity' => 'Friend',
151 'bao' => 'CRM_Friend_BAO_Friend',
155 'name' => 'entity_id',
156 'type' => CRM_Utils_Type
::T_INT
,
157 'title' => ts('Entity ID'),
158 'description' => ts('Foreign key to the referenced item.'),
160 'where' => 'civicrm_tell_friend.entity_id',
161 'table_name' => 'civicrm_tell_friend',
162 'entity' => 'Friend',
163 'bao' => 'CRM_Friend_BAO_Friend',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Title'),
171 'size' => CRM_Utils_Type
::HUGE
,
172 'where' => 'civicrm_tell_friend.title',
173 'table_name' => 'civicrm_tell_friend',
174 'entity' => 'Friend',
175 'bao' => 'CRM_Friend_BAO_Friend',
183 'type' => CRM_Utils_Type
::T_TEXT
,
184 'title' => ts('Intro'),
185 'description' => ts('Introductory message to contributor or participant displayed on the Tell a Friend form.'),
186 'where' => 'civicrm_tell_friend.intro',
187 'table_name' => 'civicrm_tell_friend',
188 'entity' => 'Friend',
189 'bao' => 'CRM_Friend_BAO_Friend',
195 'suggested_message' => [
196 'name' => 'suggested_message',
197 'type' => CRM_Utils_Type
::T_TEXT
,
198 'title' => ts('Suggested Message'),
199 'description' => ts('Suggested message to friends, provided as default on the Tell A Friend form.'),
200 'where' => 'civicrm_tell_friend.suggested_message',
201 'table_name' => 'civicrm_tell_friend',
202 'entity' => 'Friend',
203 'bao' => 'CRM_Friend_BAO_Friend',
210 'name' => 'general_link',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('General Link'),
213 'description' => ts('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',
219 'table_name' => 'civicrm_tell_friend',
220 'entity' => 'Friend',
221 'bao' => 'CRM_Friend_BAO_Friend',
227 'thankyou_title' => [
228 'name' => 'thankyou_title',
229 'type' => CRM_Utils_Type
::T_STRING
,
230 'title' => ts('Thank You Title'),
231 'description' => ts('Text for Tell a Friend thank you page header and HTML title.'),
233 'size' => CRM_Utils_Type
::HUGE
,
234 'where' => 'civicrm_tell_friend.thankyou_title',
235 'table_name' => 'civicrm_tell_friend',
236 'entity' => 'Friend',
237 'bao' => 'CRM_Friend_BAO_Friend',
244 'name' => 'thankyou_text',
245 'type' => CRM_Utils_Type
::T_TEXT
,
246 'title' => ts('Thank You Text'),
247 'description' => ts('Thank you message displayed on success page.'),
248 'where' => 'civicrm_tell_friend.thankyou_text',
249 'table_name' => 'civicrm_tell_friend',
250 'entity' => 'Friend',
251 'bao' => 'CRM_Friend_BAO_Friend',
258 'name' => 'is_active',
259 'type' => CRM_Utils_Type
::T_BOOLEAN
,
260 'title' => ts('Enabled?'),
261 'where' => 'civicrm_tell_friend.is_active',
262 'table_name' => 'civicrm_tell_friend',
263 'entity' => 'Friend',
264 'bao' => 'CRM_Friend_BAO_Friend',
267 'type' => 'CheckBox',
271 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
273 return Civi
::$statics[__CLASS__
]['fields'];
277 * Return a mapping from field-name to the corresponding key (as used in fields()).
280 * Array(string $name => string $uniqueName).
282 public static function &fieldKeys() {
283 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
284 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
286 return Civi
::$statics[__CLASS__
]['fieldKeys'];
290 * Returns the names of this table
294 public static function getTableName() {
295 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
299 * Returns if this table needs to be logged
303 public function getLog() {
308 * Returns the list of fields that can be imported
310 * @param bool $prefix
314 public static function &import($prefix = FALSE) {
315 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tell_friend', $prefix, []);
320 * Returns the list of fields that can be exported
322 * @param bool $prefix
326 public static function &export($prefix = FALSE) {
327 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tell_friend', $prefix, []);
332 * Returns the list of indices
334 * @param bool $localize
338 public static function indices($localize = TRUE) {
340 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;