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:67153c09e74eda2febf15986f9c04439)
13 * Database access object for the DashboardContact entity.
15 class CRM_Contact_DAO_DashboardContact
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_dashboard_contact';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
53 * column no for this widget
60 * Is this widget active?
67 * Ordering of the widgets.
76 public function __construct() {
77 $this->__table
= 'civicrm_dashboard_contact';
78 parent
::__construct();
82 * Returns localized title of this entity.
84 public static function getEntityTitle() {
85 return ts('Dashboard Contacts');
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dashboard_id', 'civicrm_dashboard', 'id');
98 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
99 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
101 return Civi
::$statics[__CLASS__
]['links'];
105 * Returns all the column names of this table
109 public static function &fields() {
110 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
111 Civi
::$statics[__CLASS__
]['fields'] = [
114 'type' => CRM_Utils_Type
::T_INT
,
115 'title' => ts('Dashboard Contact ID'),
117 'where' => 'civicrm_dashboard_contact.id',
118 'table_name' => 'civicrm_dashboard_contact',
119 'entity' => 'DashboardContact',
120 'bao' => 'CRM_Contact_BAO_DashboardContact',
125 'name' => 'dashboard_id',
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Dashboard'),
128 'description' => ts('Dashboard ID'),
130 'where' => 'civicrm_dashboard_contact.dashboard_id',
131 'table_name' => 'civicrm_dashboard_contact',
132 'entity' => 'DashboardContact',
133 'bao' => 'CRM_Contact_BAO_DashboardContact',
135 'FKClassName' => 'CRM_Core_DAO_Dashboard',
139 'name' => 'contact_id',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Dashboard Contact'),
142 'description' => ts('Contact ID'),
144 'where' => 'civicrm_dashboard_contact.contact_id',
145 'table_name' => 'civicrm_dashboard_contact',
146 'entity' => 'DashboardContact',
147 'bao' => 'CRM_Contact_BAO_DashboardContact',
149 'FKClassName' => 'CRM_Contact_DAO_Contact',
153 'name' => 'column_no',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Column No'),
156 'description' => ts('column no for this widget'),
157 'where' => 'civicrm_dashboard_contact.column_no',
159 'table_name' => 'civicrm_dashboard_contact',
160 'entity' => 'DashboardContact',
161 'bao' => 'CRM_Contact_BAO_DashboardContact',
166 'name' => 'is_active',
167 'type' => CRM_Utils_Type
::T_BOOLEAN
,
168 'title' => ts('Dashlet is Active?'),
169 'description' => ts('Is this widget active?'),
170 'where' => 'civicrm_dashboard_contact.is_active',
172 'table_name' => 'civicrm_dashboard_contact',
173 'entity' => 'DashboardContact',
174 'bao' => 'CRM_Contact_BAO_DashboardContact',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Order'),
182 'description' => ts('Ordering of the widgets.'),
183 'where' => 'civicrm_dashboard_contact.weight',
185 'table_name' => 'civicrm_dashboard_contact',
186 'entity' => 'DashboardContact',
187 'bao' => 'CRM_Contact_BAO_DashboardContact',
192 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
194 return Civi
::$statics[__CLASS__
]['fields'];
198 * Return a mapping from field-name to the corresponding key (as used in fields()).
201 * Array(string $name => string $uniqueName).
203 public static function &fieldKeys() {
204 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
205 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
207 return Civi
::$statics[__CLASS__
]['fieldKeys'];
211 * Returns the names of this table
215 public static function getTableName() {
216 return self
::$_tableName;
220 * Returns if this table needs to be logged
224 public function getLog() {
229 * Returns the list of fields that can be imported
231 * @param bool $prefix
235 public static function &import($prefix = FALSE) {
236 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
241 * Returns the list of fields that can be exported
243 * @param bool $prefix
247 public static function &export($prefix = FALSE) {
248 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
253 * Returns the list of indices
255 * @param bool $localize
259 public static function indices($localize = TRUE) {
261 'index_dashboard_id_contact_id' => [
262 'name' => 'index_dashboard_id_contact_id',
267 'localizable' => FALSE,
269 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
272 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;