5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Friend/Friend.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ed3cb6458bdc4ee011d6b30baa9e24ff)
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 localized title of this entity.
108 public static function getEntityTitle() {
109 return ts('Friends');
113 * Returns foreign keys and entity references.
116 * [CRM_Core_Reference_Interface]
118 public static function getReferenceColumns() {
119 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
120 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
121 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
122 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
124 return Civi
::$statics[__CLASS__
]['links'];
128 * Returns all the column names of this table
132 public static function &fields() {
133 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
134 Civi
::$statics[__CLASS__
]['fields'] = [
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('Friend ID'),
139 'description' => ts('Friend ID'),
141 'where' => 'civicrm_tell_friend.id',
142 'table_name' => 'civicrm_tell_friend',
143 'entity' => 'Friend',
144 'bao' => 'CRM_Friend_BAO_Friend',
149 'name' => 'entity_table',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Entity Table'),
152 'description' => ts('Name of table where item being referenced is stored.'),
155 'size' => CRM_Utils_Type
::BIG
,
156 'where' => 'civicrm_tell_friend.entity_table',
157 'table_name' => 'civicrm_tell_friend',
158 'entity' => 'Friend',
159 'bao' => 'CRM_Friend_BAO_Friend',
164 'name' => 'entity_id',
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Entity ID'),
167 'description' => ts('Foreign key to the referenced item.'),
169 'where' => 'civicrm_tell_friend.entity_id',
170 'table_name' => 'civicrm_tell_friend',
171 'entity' => 'Friend',
172 'bao' => 'CRM_Friend_BAO_Friend',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Title'),
181 'size' => CRM_Utils_Type
::HUGE
,
182 'where' => 'civicrm_tell_friend.title',
183 'table_name' => 'civicrm_tell_friend',
184 'entity' => 'Friend',
185 'bao' => 'CRM_Friend_BAO_Friend',
194 'type' => CRM_Utils_Type
::T_TEXT
,
195 'title' => ts('Intro'),
196 'description' => ts('Introductory message to contributor or participant displayed on the Tell a Friend form.'),
197 'where' => 'civicrm_tell_friend.intro',
198 'table_name' => 'civicrm_tell_friend',
199 'entity' => 'Friend',
200 'bao' => 'CRM_Friend_BAO_Friend',
207 'suggested_message' => [
208 'name' => 'suggested_message',
209 'type' => CRM_Utils_Type
::T_TEXT
,
210 'title' => ts('Suggested Message'),
211 'description' => ts('Suggested message to friends, provided as default on the Tell A Friend form.'),
212 'where' => 'civicrm_tell_friend.suggested_message',
213 'table_name' => 'civicrm_tell_friend',
214 'entity' => 'Friend',
215 'bao' => 'CRM_Friend_BAO_Friend',
223 'name' => 'general_link',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('General Link'),
226 'description' => ts('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',
232 'table_name' => 'civicrm_tell_friend',
233 'entity' => 'Friend',
234 'bao' => 'CRM_Friend_BAO_Friend',
241 'thankyou_title' => [
242 'name' => 'thankyou_title',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Thank You Title'),
245 'description' => ts('Text for Tell a Friend thank you page header and HTML title.'),
247 'size' => CRM_Utils_Type
::HUGE
,
248 'where' => 'civicrm_tell_friend.thankyou_title',
249 'table_name' => 'civicrm_tell_friend',
250 'entity' => 'Friend',
251 'bao' => 'CRM_Friend_BAO_Friend',
259 'name' => 'thankyou_text',
260 'type' => CRM_Utils_Type
::T_TEXT
,
261 'title' => ts('Thank You Text'),
262 'description' => ts('Thank you message displayed on success page.'),
263 'where' => 'civicrm_tell_friend.thankyou_text',
264 'table_name' => 'civicrm_tell_friend',
265 'entity' => 'Friend',
266 'bao' => 'CRM_Friend_BAO_Friend',
274 'name' => 'is_active',
275 'type' => CRM_Utils_Type
::T_BOOLEAN
,
276 'title' => ts('Enabled?'),
277 'where' => 'civicrm_tell_friend.is_active',
278 'table_name' => 'civicrm_tell_friend',
279 'entity' => 'Friend',
280 'bao' => 'CRM_Friend_BAO_Friend',
283 'type' => 'CheckBox',
288 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
290 return Civi
::$statics[__CLASS__
]['fields'];
294 * Return a mapping from field-name to the corresponding key (as used in fields()).
297 * Array(string $name => string $uniqueName).
299 public static function &fieldKeys() {
300 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
301 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
303 return Civi
::$statics[__CLASS__
]['fieldKeys'];
307 * Returns the names of this table
311 public static function getTableName() {
312 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
316 * Returns if this table needs to be logged
320 public function getLog() {
325 * Returns the list of fields that can be imported
327 * @param bool $prefix
331 public static function &import($prefix = FALSE) {
332 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tell_friend', $prefix, []);
337 * Returns the list of fields that can be exported
339 * @param bool $prefix
343 public static function &export($prefix = FALSE) {
344 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tell_friend', $prefix, []);
349 * Returns the list of indices
351 * @param bool $localize
355 public static function indices($localize = TRUE) {
357 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;