Set version to 4.7.19
[civicrm-core.git] / CRM / Contact / DAO / DashboardContact.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Contact/DashboardContact.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5b6c6d2ccc579b98b3300c77898e596e)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Contact_DAO_DashboardContact constructor.
39 */
40 class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_dashboard_contact';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * Dashboard ID
60 *
61 * @var int unsigned
62 */
63 public $dashboard_id;
64 /**
65 * Contact ID
66 *
67 * @var int unsigned
68 */
69 public $contact_id;
70 /**
71 * column no for this widget
72 *
73 * @var boolean
74 */
75 public $column_no;
76 /**
77 * Is this widget active?
78 *
79 * @var boolean
80 */
81 public $is_active;
82 /**
83 * Ordering of the widgets.
84 *
85 * @var int
86 */
87 public $weight;
88 /**
89 * Class constructor.
90 */
91 function __construct() {
92 $this->__table = 'civicrm_dashboard_contact';
93 parent::__construct();
94 }
95 /**
96 * Returns foreign keys and entity references.
97 *
98 * @return array
99 * [CRM_Core_Reference_Interface]
100 */
101 static function getReferenceColumns() {
102 if (!isset(Civi::$statics[__CLASS__]['links'])) {
103 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
104 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dashboard_id', 'civicrm_dashboard', 'id');
105 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id');
106 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
107 }
108 return Civi::$statics[__CLASS__]['links'];
109 }
110 /**
111 * Returns all the column names of this table
112 *
113 * @return array
114 */
115 static function &fields() {
116 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
117 Civi::$statics[__CLASS__]['fields'] = array(
118 'id' => array(
119 'name' => 'id',
120 'type' => CRM_Utils_Type::T_INT,
121 'title' => ts('Dashboard Contact ID') ,
122 'required' => true,
123 'table_name' => 'civicrm_dashboard_contact',
124 'entity' => 'DashboardContact',
125 'bao' => 'CRM_Contact_BAO_DashboardContact',
126 ) ,
127 'dashboard_id' => array(
128 'name' => 'dashboard_id',
129 'type' => CRM_Utils_Type::T_INT,
130 'title' => ts('Dashboard') ,
131 'description' => 'Dashboard ID',
132 'required' => true,
133 'table_name' => 'civicrm_dashboard_contact',
134 'entity' => 'DashboardContact',
135 'bao' => 'CRM_Contact_BAO_DashboardContact',
136 'FKClassName' => 'CRM_Core_DAO_Dashboard',
137 ) ,
138 'contact_id' => array(
139 'name' => 'contact_id',
140 'type' => CRM_Utils_Type::T_INT,
141 'title' => ts('Dashboard Contact') ,
142 'description' => 'Contact ID',
143 'required' => true,
144 'table_name' => 'civicrm_dashboard_contact',
145 'entity' => 'DashboardContact',
146 'bao' => 'CRM_Contact_BAO_DashboardContact',
147 'FKClassName' => 'CRM_Contact_DAO_Contact',
148 ) ,
149 'column_no' => array(
150 'name' => 'column_no',
151 'type' => CRM_Utils_Type::T_BOOLEAN,
152 'title' => ts('Column No') ,
153 'description' => 'column no for this widget',
154 'table_name' => 'civicrm_dashboard_contact',
155 'entity' => 'DashboardContact',
156 'bao' => 'CRM_Contact_BAO_DashboardContact',
157 ) ,
158 'is_active' => array(
159 'name' => 'is_active',
160 'type' => CRM_Utils_Type::T_BOOLEAN,
161 'title' => ts('Dashlet is Active?') ,
162 'description' => 'Is this widget active?',
163 'table_name' => 'civicrm_dashboard_contact',
164 'entity' => 'DashboardContact',
165 'bao' => 'CRM_Contact_BAO_DashboardContact',
166 ) ,
167 'weight' => array(
168 'name' => 'weight',
169 'type' => CRM_Utils_Type::T_INT,
170 'title' => ts('Order') ,
171 'description' => 'Ordering of the widgets.',
172 'table_name' => 'civicrm_dashboard_contact',
173 'entity' => 'DashboardContact',
174 'bao' => 'CRM_Contact_BAO_DashboardContact',
175 ) ,
176 );
177 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
178 }
179 return Civi::$statics[__CLASS__]['fields'];
180 }
181 /**
182 * Return a mapping from field-name to the corresponding key (as used in fields()).
183 *
184 * @return array
185 * Array(string $name => string $uniqueName).
186 */
187 static function &fieldKeys() {
188 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
189 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
190 }
191 return Civi::$statics[__CLASS__]['fieldKeys'];
192 }
193 /**
194 * Returns the names of this table
195 *
196 * @return string
197 */
198 static function getTableName() {
199 return self::$_tableName;
200 }
201 /**
202 * Returns if this table needs to be logged
203 *
204 * @return boolean
205 */
206 function getLog() {
207 return self::$_log;
208 }
209 /**
210 * Returns the list of fields that can be imported
211 *
212 * @param bool $prefix
213 *
214 * @return array
215 */
216 static function &import($prefix = false) {
217 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard_contact', $prefix, array());
218 return $r;
219 }
220 /**
221 * Returns the list of fields that can be exported
222 *
223 * @param bool $prefix
224 *
225 * @return array
226 */
227 static function &export($prefix = false) {
228 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard_contact', $prefix, array());
229 return $r;
230 }
231 }