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:ca2325df4ca179436e4901bbed693e20)
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;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
59 * column no for this widget
61 * @var int|string|null
63 * Note that values will be retrieved from the database as a string.
68 * Is this widget active?
72 * Note that values will be retrieved from the database as a string.
77 * Ordering of the widgets.
79 * @var int|string|null
81 * Note that values will be retrieved from the database as a string.
88 public function __construct() {
89 $this->__table
= 'civicrm_dashboard_contact';
90 parent
::__construct();
94 * Returns localized title of this entity.
97 * Whether to return the plural version of the title.
99 public static function getEntityTitle($plural = FALSE) {
100 return $plural ?
ts('Dashboard Contacts') : ts('Dashboard Contact');
104 * Returns foreign keys and entity references.
107 * [CRM_Core_Reference_Interface]
109 public static function getReferenceColumns() {
110 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
111 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
112 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dashboard_id', 'civicrm_dashboard', 'id');
113 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
114 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
116 return Civi
::$statics[__CLASS__
]['links'];
120 * Returns all the column names of this table
124 public static function &fields() {
125 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
126 Civi
::$statics[__CLASS__
]['fields'] = [
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Dashboard Contact ID'),
132 'where' => 'civicrm_dashboard_contact.id',
133 'table_name' => 'civicrm_dashboard_contact',
134 'entity' => 'DashboardContact',
135 'bao' => 'CRM_Contact_BAO_DashboardContact',
144 'name' => 'dashboard_id',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Dashboard ID'),
147 'description' => ts('Dashboard ID'),
149 'where' => 'civicrm_dashboard_contact.dashboard_id',
150 'table_name' => 'civicrm_dashboard_contact',
151 'entity' => 'DashboardContact',
152 'bao' => 'CRM_Contact_BAO_DashboardContact',
154 'FKClassName' => 'CRM_Core_DAO_Dashboard',
156 'label' => ts("Dashboard"),
161 'name' => 'contact_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Contact ID'),
164 'description' => ts('Contact ID'),
166 'where' => 'civicrm_dashboard_contact.contact_id',
167 'table_name' => 'civicrm_dashboard_contact',
168 'entity' => 'DashboardContact',
169 'bao' => 'CRM_Contact_BAO_DashboardContact',
171 'FKClassName' => 'CRM_Contact_DAO_Contact',
173 'label' => ts("Contact"),
178 'name' => 'column_no',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Column No'),
181 'description' => ts('column no for this widget'),
182 'where' => 'civicrm_dashboard_contact.column_no',
184 'table_name' => 'civicrm_dashboard_contact',
185 'entity' => 'DashboardContact',
186 'bao' => 'CRM_Contact_BAO_DashboardContact',
189 'label' => ts("Column Number"),
194 'name' => 'is_active',
195 'type' => CRM_Utils_Type
::T_BOOLEAN
,
196 'title' => ts('Dashlet is Active?'),
197 'description' => ts('Is this widget active?'),
199 'where' => 'civicrm_dashboard_contact.is_active',
201 'table_name' => 'civicrm_dashboard_contact',
202 'entity' => 'DashboardContact',
203 'bao' => 'CRM_Contact_BAO_DashboardContact',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Order'),
211 'description' => ts('Ordering of the widgets.'),
212 'where' => 'civicrm_dashboard_contact.weight',
214 'table_name' => 'civicrm_dashboard_contact',
215 'entity' => 'DashboardContact',
216 'bao' => 'CRM_Contact_BAO_DashboardContact',
221 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
223 return Civi
::$statics[__CLASS__
]['fields'];
227 * Return a mapping from field-name to the corresponding key (as used in fields()).
230 * Array(string $name => string $uniqueName).
232 public static function &fieldKeys() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
234 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
236 return Civi
::$statics[__CLASS__
]['fieldKeys'];
240 * Returns the names of this table
244 public static function getTableName() {
245 return self
::$_tableName;
249 * Returns if this table needs to be logged
253 public function getLog() {
258 * Returns the list of fields that can be imported
260 * @param bool $prefix
264 public static function &import($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
270 * Returns the list of fields that can be exported
272 * @param bool $prefix
276 public static function &export($prefix = FALSE) {
277 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
282 * Returns the list of indices
284 * @param bool $localize
288 public static function indices($localize = TRUE) {
290 'index_dashboard_id_contact_id' => [
291 'name' => 'index_dashboard_id_contact_id',
296 'localizable' => FALSE,
298 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
301 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;