5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Friend/Friend.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0f2c6f4aab46e551d1e3ec7fdd55f0f5)
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 static $_tableName = 'civicrm_tell_friend';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_tell_friend',
135 'entity' => 'Friend',
136 'bao' => 'CRM_Friend_BAO_Friend',
140 'name' => 'entity_table',
141 'type' => CRM_Utils_Type
::T_STRING
,
142 'title' => ts('Entity Table'),
143 'description' => ts('Name of table where item being referenced is stored.'),
146 'size' => CRM_Utils_Type
::BIG
,
147 'table_name' => 'civicrm_tell_friend',
148 'entity' => 'Friend',
149 'bao' => 'CRM_Friend_BAO_Friend',
153 'name' => 'entity_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Entity ID'),
156 'description' => ts('Foreign key to the referenced item.'),
158 'table_name' => 'civicrm_tell_friend',
159 'entity' => 'Friend',
160 'bao' => 'CRM_Friend_BAO_Friend',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Title'),
168 'size' => CRM_Utils_Type
::HUGE
,
169 'table_name' => 'civicrm_tell_friend',
170 'entity' => 'Friend',
171 'bao' => 'CRM_Friend_BAO_Friend',
179 'type' => CRM_Utils_Type
::T_TEXT
,
180 'title' => ts('Intro'),
181 'description' => ts('Introductory message to contributor or participant displayed on the Tell a Friend form.'),
182 'table_name' => 'civicrm_tell_friend',
183 'entity' => 'Friend',
184 'bao' => 'CRM_Friend_BAO_Friend',
190 'suggested_message' => [
191 'name' => 'suggested_message',
192 'type' => CRM_Utils_Type
::T_TEXT
,
193 'title' => ts('Suggested Message'),
194 'description' => ts('Suggested message to friends, provided as default on the Tell A Friend form.'),
195 'table_name' => 'civicrm_tell_friend',
196 'entity' => 'Friend',
197 'bao' => 'CRM_Friend_BAO_Friend',
204 'name' => 'general_link',
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('General Link'),
207 'description' => ts('URL for general info about the organization - included in the email sent to friends.'),
209 'size' => CRM_Utils_Type
::HUGE
,
211 'where' => 'civicrm_tell_friend.general_link',
212 'headerPattern' => '',
215 'table_name' => 'civicrm_tell_friend',
216 'entity' => 'Friend',
217 'bao' => 'CRM_Friend_BAO_Friend',
223 'thankyou_title' => [
224 'name' => 'thankyou_title',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Thank You Title'),
227 'description' => ts('Text for Tell a Friend thank you page header and HTML title.'),
229 'size' => CRM_Utils_Type
::HUGE
,
230 'table_name' => 'civicrm_tell_friend',
231 'entity' => 'Friend',
232 'bao' => 'CRM_Friend_BAO_Friend',
239 'name' => 'thankyou_text',
240 'type' => CRM_Utils_Type
::T_TEXT
,
241 'title' => ts('Thank You Text'),
242 'description' => ts('Thank you message displayed on success page.'),
243 'table_name' => 'civicrm_tell_friend',
244 'entity' => 'Friend',
245 'bao' => 'CRM_Friend_BAO_Friend',
252 'name' => 'is_active',
253 'type' => CRM_Utils_Type
::T_BOOLEAN
,
254 'title' => ts('Enabled?'),
255 'table_name' => 'civicrm_tell_friend',
256 'entity' => 'Friend',
257 'bao' => 'CRM_Friend_BAO_Friend',
260 'type' => 'CheckBox',
264 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
266 return Civi
::$statics[__CLASS__
]['fields'];
270 * Return a mapping from field-name to the corresponding key (as used in fields()).
273 * Array(string $name => string $uniqueName).
275 public static function &fieldKeys() {
276 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
277 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
279 return Civi
::$statics[__CLASS__
]['fieldKeys'];
283 * Returns the names of this table
287 public static function getTableName() {
288 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
292 * Returns if this table needs to be logged
296 public function getLog() {
301 * Returns the list of fields that can be imported
303 * @param bool $prefix
307 public static function &import($prefix = FALSE) {
308 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'tell_friend', $prefix, []);
313 * Returns the list of fields that can be exported
315 * @param bool $prefix
319 public static function &export($prefix = FALSE) {
320 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'tell_friend', $prefix, []);
325 * Returns the list of indices
327 * @param bool $localize
331 public static function indices($localize = TRUE) {
333 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;