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:ef3a393d20b6654dcef952f21df8072d)
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',
128 'name' => 'dashboard_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Dashboard'),
131 'description' => ts('Dashboard ID'),
133 'where' => 'civicrm_dashboard_contact.dashboard_id',
134 'table_name' => 'civicrm_dashboard_contact',
135 'entity' => 'DashboardContact',
136 'bao' => 'CRM_Contact_BAO_DashboardContact',
138 'FKClassName' => 'CRM_Core_DAO_Dashboard',
142 'name' => 'contact_id',
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Dashboard Contact'),
145 'description' => ts('Contact ID'),
147 'where' => 'civicrm_dashboard_contact.contact_id',
148 'table_name' => 'civicrm_dashboard_contact',
149 'entity' => 'DashboardContact',
150 'bao' => 'CRM_Contact_BAO_DashboardContact',
152 'FKClassName' => 'CRM_Contact_DAO_Contact',
156 'name' => 'column_no',
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Column No'),
159 'description' => ts('column no for this widget'),
160 'where' => 'civicrm_dashboard_contact.column_no',
162 'table_name' => 'civicrm_dashboard_contact',
163 'entity' => 'DashboardContact',
164 'bao' => 'CRM_Contact_BAO_DashboardContact',
169 'name' => 'is_active',
170 'type' => CRM_Utils_Type
::T_BOOLEAN
,
171 'title' => ts('Dashlet is Active?'),
172 'description' => ts('Is this widget active?'),
173 'where' => 'civicrm_dashboard_contact.is_active',
175 'table_name' => 'civicrm_dashboard_contact',
176 'entity' => 'DashboardContact',
177 'bao' => 'CRM_Contact_BAO_DashboardContact',
183 'type' => CRM_Utils_Type
::T_INT
,
184 'title' => ts('Order'),
185 'description' => ts('Ordering of the widgets.'),
186 'where' => 'civicrm_dashboard_contact.weight',
188 'table_name' => 'civicrm_dashboard_contact',
189 'entity' => 'DashboardContact',
190 'bao' => 'CRM_Contact_BAO_DashboardContact',
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
197 return Civi
::$statics[__CLASS__
]['fields'];
201 * Return a mapping from field-name to the corresponding key (as used in fields()).
204 * Array(string $name => string $uniqueName).
206 public static function &fieldKeys() {
207 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
208 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
210 return Civi
::$statics[__CLASS__
]['fieldKeys'];
214 * Returns the names of this table
218 public static function getTableName() {
219 return self
::$_tableName;
223 * Returns if this table needs to be logged
227 public function getLog() {
232 * Returns the list of fields that can be imported
234 * @param bool $prefix
238 public static function &import($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard_contact', $prefix, []);
244 * Returns the list of fields that can be exported
246 * @param bool $prefix
250 public static function &export($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard_contact', $prefix, []);
256 * Returns the list of indices
258 * @param bool $localize
262 public static function indices($localize = TRUE) {
264 'index_dashboard_id_contact_id' => [
265 'name' => 'index_dashboard_id_contact_id',
270 'localizable' => FALSE,
272 'sig' => 'civicrm_dashboard_contact::1::dashboard_id::contact_id',
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;