5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contact/DashboardContact.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e2e825929c6c5404e7649fdde3162597)
13 * Database access object for the DashboardContact entity.
15 class CRM_Contact_DAO_DashboardContact
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_dashboard_contact';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
51 * column no for this widget
58 * Is this widget active?
65 * Ordering of the widgets.
74 public function __construct() {
75 $this->__table
= 'civicrm_dashboard_contact';
76 parent
::__construct();
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dashboard_id', 'civicrm_dashboard', 'id');
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
90 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
92 return Civi
::$statics[__CLASS__
]['links'];
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Dashboard Contact ID'),
108 'where' => 'civicrm_dashboard_contact.id',
109 'table_name' => 'civicrm_dashboard_contact',
110 'entity' => 'DashboardContact',
111 'bao' => 'CRM_Contact_BAO_DashboardContact',
115 'name' => 'dashboard_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Dashboard'),
118 'description' => ts('Dashboard ID'),
120 'where' => 'civicrm_dashboard_contact.dashboard_id',
121 'table_name' => 'civicrm_dashboard_contact',
122 'entity' => 'DashboardContact',
123 'bao' => 'CRM_Contact_BAO_DashboardContact',
125 'FKClassName' => 'CRM_Core_DAO_Dashboard',
128 'name' => 'contact_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Dashboard Contact'),
131 'description' => ts('Contact ID'),
133 'where' => 'civicrm_dashboard_contact.contact_id',
134 'table_name' => 'civicrm_dashboard_contact',
135 'entity' => 'DashboardContact',
136 'bao' => 'CRM_Contact_BAO_DashboardContact',
138 'FKClassName' => 'CRM_Contact_DAO_Contact',
141 'name' => 'column_no',
142 'type' => CRM_Utils_Type
::T_BOOLEAN
,
143 'title' => ts('Column No'),
144 'description' => ts('column no for this widget'),
145 'where' => 'civicrm_dashboard_contact.column_no',
147 'table_name' => 'civicrm_dashboard_contact',
148 'entity' => 'DashboardContact',
149 'bao' => 'CRM_Contact_BAO_DashboardContact',
153 'name' => 'is_active',
154 'type' => CRM_Utils_Type
::T_BOOLEAN
,
155 'title' => ts('Dashlet is Active?'),
156 'description' => ts('Is this widget active?'),
157 'where' => 'civicrm_dashboard_contact.is_active',
159 'table_name' => 'civicrm_dashboard_contact',
160 'entity' => 'DashboardContact',
161 'bao' => 'CRM_Contact_BAO_DashboardContact',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Order'),
168 'description' => ts('Ordering of the widgets.'),
169 'where' => 'civicrm_dashboard_contact.weight',
171 'table_name' => 'civicrm_dashboard_contact',
172 'entity' => 'DashboardContact',
173 'bao' => 'CRM_Contact_BAO_DashboardContact',
177 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
179 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 public static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
196 * Returns the names of this table
200 public static function getTableName() {
201 return self
::$_tableName;
205 * Returns if this table needs to be logged
209 public function getLog() {
214 * Returns the list of fields that can be imported
216 * @param bool $prefix
220 public static function &import($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
226 * Returns the list of fields that can be exported
228 * @param bool $prefix
232 public static function &export($prefix = FALSE) {
233 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
238 * Returns the list of indices
240 * @param bool $localize
244 public static function indices($localize = TRUE) {
246 'index_dashboard_id_contact_id' => [
247 'name' => 'index_dashboard_id_contact_id',
252 'localizable' => FALSE,
254 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
257 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;