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:ebe84476b55f9383d54e5a645f657f83)
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 localized title of this entity.
82 public static function getEntityTitle() {
83 return ts('Dashboard Contacts');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dashboard_id', 'civicrm_dashboard', 'id');
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Dashboard Contact ID'),
115 'where' => 'civicrm_dashboard_contact.id',
116 'table_name' => 'civicrm_dashboard_contact',
117 'entity' => 'DashboardContact',
118 'bao' => 'CRM_Contact_BAO_DashboardContact',
122 'name' => 'dashboard_id',
123 'type' => CRM_Utils_Type
::T_INT
,
124 'title' => ts('Dashboard'),
125 'description' => ts('Dashboard ID'),
127 'where' => 'civicrm_dashboard_contact.dashboard_id',
128 'table_name' => 'civicrm_dashboard_contact',
129 'entity' => 'DashboardContact',
130 'bao' => 'CRM_Contact_BAO_DashboardContact',
132 'FKClassName' => 'CRM_Core_DAO_Dashboard',
135 'name' => 'contact_id',
136 'type' => CRM_Utils_Type
::T_INT
,
137 'title' => ts('Dashboard Contact'),
138 'description' => ts('Contact ID'),
140 'where' => 'civicrm_dashboard_contact.contact_id',
141 'table_name' => 'civicrm_dashboard_contact',
142 'entity' => 'DashboardContact',
143 'bao' => 'CRM_Contact_BAO_DashboardContact',
145 'FKClassName' => 'CRM_Contact_DAO_Contact',
148 'name' => 'column_no',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Column No'),
151 'description' => ts('column no for this widget'),
152 'where' => 'civicrm_dashboard_contact.column_no',
154 'table_name' => 'civicrm_dashboard_contact',
155 'entity' => 'DashboardContact',
156 'bao' => 'CRM_Contact_BAO_DashboardContact',
160 'name' => 'is_active',
161 'type' => CRM_Utils_Type
::T_BOOLEAN
,
162 'title' => ts('Dashlet is Active?'),
163 'description' => ts('Is this widget active?'),
164 'where' => 'civicrm_dashboard_contact.is_active',
166 'table_name' => 'civicrm_dashboard_contact',
167 'entity' => 'DashboardContact',
168 'bao' => 'CRM_Contact_BAO_DashboardContact',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Order'),
175 'description' => ts('Ordering of the widgets.'),
176 'where' => 'civicrm_dashboard_contact.weight',
178 'table_name' => 'civicrm_dashboard_contact',
179 'entity' => 'DashboardContact',
180 'bao' => 'CRM_Contact_BAO_DashboardContact',
184 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
186 return Civi
::$statics[__CLASS__
]['fields'];
190 * Return a mapping from field-name to the corresponding key (as used in fields()).
193 * Array(string $name => string $uniqueName).
195 public static function &fieldKeys() {
196 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
197 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
199 return Civi
::$statics[__CLASS__
]['fieldKeys'];
203 * Returns the names of this table
207 public static function getTableName() {
208 return self
::$_tableName;
212 * Returns if this table needs to be logged
216 public function getLog() {
221 * Returns the list of fields that can be imported
223 * @param bool $prefix
227 public static function &import($prefix = FALSE) {
228 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
233 * Returns the list of fields that can be exported
235 * @param bool $prefix
239 public static function &export($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
245 * Returns the list of indices
247 * @param bool $localize
251 public static function indices($localize = TRUE) {
253 'index_dashboard_id_contact_id' => [
254 'name' => 'index_dashboard_id_contact_id',
259 'localizable' => FALSE,
261 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
264 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;