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:a2eac9e772485e4a551738ad107dc209)
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.
85 * Whether to return the plural version of the title.
87 public static function getEntityTitle($plural = FALSE) {
88 return $plural ?
ts('Dashboard Contacts') : ts('Dashboard Contact');
92 * Returns foreign keys and entity references.
95 * [CRM_Core_Reference_Interface]
97 public static function getReferenceColumns() {
98 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
99 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
100 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dashboard_id', 'civicrm_dashboard', 'id');
101 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
102 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
104 return Civi
::$statics[__CLASS__
]['links'];
108 * Returns all the column names of this table
112 public static function &fields() {
113 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
114 Civi
::$statics[__CLASS__
]['fields'] = [
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Dashboard Contact ID'),
120 'where' => 'civicrm_dashboard_contact.id',
121 'table_name' => 'civicrm_dashboard_contact',
122 'entity' => 'DashboardContact',
123 'bao' => 'CRM_Contact_BAO_DashboardContact',
132 'name' => 'dashboard_id',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Dashboard ID'),
135 'description' => ts('Dashboard ID'),
137 'where' => 'civicrm_dashboard_contact.dashboard_id',
138 'table_name' => 'civicrm_dashboard_contact',
139 'entity' => 'DashboardContact',
140 'bao' => 'CRM_Contact_BAO_DashboardContact',
142 'FKClassName' => 'CRM_Core_DAO_Dashboard',
144 'label' => ts("Dashboard"),
149 'name' => 'contact_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Contact ID'),
152 'description' => ts('Contact ID'),
154 'where' => 'civicrm_dashboard_contact.contact_id',
155 'table_name' => 'civicrm_dashboard_contact',
156 'entity' => 'DashboardContact',
157 'bao' => 'CRM_Contact_BAO_DashboardContact',
159 'FKClassName' => 'CRM_Contact_DAO_Contact',
161 'label' => ts("Contact"),
166 'name' => 'column_no',
167 'type' => CRM_Utils_Type
::T_INT
,
168 'title' => ts('Column No'),
169 'description' => ts('column no for this widget'),
170 'where' => 'civicrm_dashboard_contact.column_no',
172 'table_name' => 'civicrm_dashboard_contact',
173 'entity' => 'DashboardContact',
174 'bao' => 'CRM_Contact_BAO_DashboardContact',
177 'label' => ts("Column Number"),
182 'name' => 'is_active',
183 'type' => CRM_Utils_Type
::T_BOOLEAN
,
184 'title' => ts('Dashlet is Active?'),
185 'description' => ts('Is this widget active?'),
186 'where' => 'civicrm_dashboard_contact.is_active',
188 'table_name' => 'civicrm_dashboard_contact',
189 'entity' => 'DashboardContact',
190 'bao' => 'CRM_Contact_BAO_DashboardContact',
196 'type' => CRM_Utils_Type
::T_INT
,
197 'title' => ts('Order'),
198 'description' => ts('Ordering of the widgets.'),
199 'where' => 'civicrm_dashboard_contact.weight',
201 'table_name' => 'civicrm_dashboard_contact',
202 'entity' => 'DashboardContact',
203 'bao' => 'CRM_Contact_BAO_DashboardContact',
208 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
210 return Civi
::$statics[__CLASS__
]['fields'];
214 * Return a mapping from field-name to the corresponding key (as used in fields()).
217 * Array(string $name => string $uniqueName).
219 public static function &fieldKeys() {
220 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
221 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
223 return Civi
::$statics[__CLASS__
]['fieldKeys'];
227 * Returns the names of this table
231 public static function getTableName() {
232 return self
::$_tableName;
236 * Returns if this table needs to be logged
240 public function getLog() {
245 * Returns the list of fields that can be imported
247 * @param bool $prefix
251 public static function &import($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
257 * Returns the list of fields that can be exported
259 * @param bool $prefix
263 public static function &export($prefix = FALSE) {
264 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
269 * Returns the list of indices
271 * @param bool $localize
275 public static function indices($localize = TRUE) {
277 'index_dashboard_id_contact_id' => [
278 'name' => 'index_dashboard_id_contact_id',
283 'localizable' => FALSE,
285 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
288 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;