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:c6084fad33e2fed9634eee46cfcfd4ee)
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',
123 'name' => 'dashboard_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Dashboard'),
126 'description' => ts('Dashboard ID'),
128 'where' => 'civicrm_dashboard_contact.dashboard_id',
129 'table_name' => 'civicrm_dashboard_contact',
130 'entity' => 'DashboardContact',
131 'bao' => 'CRM_Contact_BAO_DashboardContact',
133 'FKClassName' => 'CRM_Core_DAO_Dashboard',
137 'name' => 'contact_id',
138 'type' => CRM_Utils_Type
::T_INT
,
139 'title' => ts('Dashboard Contact'),
140 'description' => ts('Contact ID'),
142 'where' => 'civicrm_dashboard_contact.contact_id',
143 'table_name' => 'civicrm_dashboard_contact',
144 'entity' => 'DashboardContact',
145 'bao' => 'CRM_Contact_BAO_DashboardContact',
147 'FKClassName' => 'CRM_Contact_DAO_Contact',
151 'name' => 'column_no',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Column No'),
154 'description' => ts('column no for this widget'),
155 'where' => 'civicrm_dashboard_contact.column_no',
157 'table_name' => 'civicrm_dashboard_contact',
158 'entity' => 'DashboardContact',
159 'bao' => 'CRM_Contact_BAO_DashboardContact',
164 'name' => 'is_active',
165 'type' => CRM_Utils_Type
::T_BOOLEAN
,
166 'title' => ts('Dashlet is Active?'),
167 'description' => ts('Is this widget active?'),
168 'where' => 'civicrm_dashboard_contact.is_active',
170 'table_name' => 'civicrm_dashboard_contact',
171 'entity' => 'DashboardContact',
172 'bao' => 'CRM_Contact_BAO_DashboardContact',
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Order'),
180 'description' => ts('Ordering of the widgets.'),
181 'where' => 'civicrm_dashboard_contact.weight',
183 'table_name' => 'civicrm_dashboard_contact',
184 'entity' => 'DashboardContact',
185 'bao' => 'CRM_Contact_BAO_DashboardContact',
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
192 return Civi
::$statics[__CLASS__
]['fields'];
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
199 * Array(string $name => string $uniqueName).
201 public static function &fieldKeys() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
203 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
205 return Civi
::$statics[__CLASS__
]['fieldKeys'];
209 * Returns the names of this table
213 public static function getTableName() {
214 return self
::$_tableName;
218 * Returns if this table needs to be logged
222 public function getLog() {
227 * Returns the list of fields that can be imported
229 * @param bool $prefix
233 public static function &import($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
239 * Returns the list of fields that can be exported
241 * @param bool $prefix
245 public static function &export($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
251 * Returns the list of indices
253 * @param bool $localize
257 public static function indices($localize = TRUE) {
259 'index_dashboard_id_contact_id' => [
260 'name' => 'index_dashboard_id_contact_id',
265 'localizable' => FALSE,
267 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
270 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;