Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
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-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Contact/DashboardContact.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
bf7df0ec | 33 | * (GenCodeChecksum:21ce0d18eb988e90850ba4f5e56c161f) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_dashboard_contact'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = false; | |
51 | /** | |
52 | * | |
53 | * @var int unsigned | |
54 | */ | |
55 | public $id; | |
56 | /** | |
57 | * Dashboard ID | |
58 | * | |
59 | * @var int unsigned | |
60 | */ | |
61 | public $dashboard_id; | |
62 | /** | |
63 | * Contact ID | |
64 | * | |
65 | * @var int unsigned | |
66 | */ | |
67 | public $contact_id; | |
68 | /** | |
69 | * column no for this widget | |
70 | * | |
71 | * @var boolean | |
72 | */ | |
73 | public $column_no; | |
e501603b TO |
74 | /** |
75 | * Is this widget active? | |
76 | * | |
77 | * @var boolean | |
78 | */ | |
79 | public $is_active; | |
80 | /** | |
81 | * Ordering of the widgets. | |
82 | * | |
83 | * @var int | |
84 | */ | |
85 | public $weight; | |
e501603b TO |
86 | /** |
87 | * class constructor | |
88 | * | |
89 | * @return civicrm_dashboard_contact | |
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() { | |
346aaaba TO |
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']); | |
e501603b | 107 | } |
346aaaba | 108 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
109 | } |
110 | /** | |
111 | * Returns all the column names of this table | |
112 | * | |
113 | * @return array | |
114 | */ | |
115 | static function &fields() { | |
346aaaba TO |
116 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
117 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
118 | 'id' => array( |
119 | 'name' => 'id', | |
120 | 'type' => CRM_Utils_Type::T_INT, | |
121 | 'title' => ts('Dashboard Contact ID') , | |
122 | 'required' => true, | |
123 | ) , | |
124 | 'dashboard_id' => array( | |
125 | 'name' => 'dashboard_id', | |
126 | 'type' => CRM_Utils_Type::T_INT, | |
127 | 'title' => ts('Dashboard') , | |
128 | 'description' => 'Dashboard ID', | |
129 | 'required' => true, | |
130 | 'FKClassName' => 'CRM_Core_DAO_Dashboard', | |
131 | ) , | |
132 | 'contact_id' => array( | |
133 | 'name' => 'contact_id', | |
134 | 'type' => CRM_Utils_Type::T_INT, | |
135 | 'title' => ts('Dashboard Contact') , | |
136 | 'description' => 'Contact ID', | |
137 | 'required' => true, | |
138 | 'FKClassName' => 'CRM_Contact_DAO_Contact', | |
139 | ) , | |
140 | 'column_no' => array( | |
141 | 'name' => 'column_no', | |
142 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
143 | 'title' => ts('Column No') , | |
144 | 'description' => 'column no for this widget', | |
145 | ) , | |
e501603b TO |
146 | 'is_active' => array( |
147 | 'name' => 'is_active', | |
148 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
149 | 'title' => ts('Dashlet is Active?') , | |
150 | 'description' => 'Is this widget active?', | |
151 | ) , | |
152 | 'weight' => array( | |
153 | 'name' => 'weight', | |
154 | 'type' => CRM_Utils_Type::T_INT, | |
155 | 'title' => ts('Order') , | |
156 | 'description' => 'Ordering of the widgets.', | |
157 | ) , | |
e501603b | 158 | ); |
346aaaba | 159 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 160 | } |
346aaaba | 161 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
162 | } |
163 | /** | |
bd8e0b14 | 164 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
165 | * |
166 | * @return array | |
bd8e0b14 | 167 | * Array(string $name => string $uniqueName). |
e501603b TO |
168 | */ |
169 | static function &fieldKeys() { | |
bd8e0b14 TO |
170 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
171 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 172 | } |
bd8e0b14 | 173 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
174 | } |
175 | /** | |
176 | * Returns the names of this table | |
177 | * | |
178 | * @return string | |
179 | */ | |
180 | static function getTableName() { | |
181 | return self::$_tableName; | |
182 | } | |
183 | /** | |
184 | * Returns if this table needs to be logged | |
185 | * | |
186 | * @return boolean | |
187 | */ | |
188 | function getLog() { | |
189 | return self::$_log; | |
190 | } | |
191 | /** | |
192 | * Returns the list of fields that can be imported | |
193 | * | |
194 | * @param bool $prefix | |
195 | * | |
196 | * @return array | |
197 | */ | |
198 | static function &import($prefix = false) { | |
60808919 TO |
199 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard_contact', $prefix, array()); |
200 | return $r; | |
e501603b TO |
201 | } |
202 | /** | |
203 | * Returns the list of fields that can be exported | |
204 | * | |
205 | * @param bool $prefix | |
206 | * | |
207 | * @return array | |
208 | */ | |
209 | static function &export($prefix = false) { | |
60808919 TO |
210 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard_contact', $prefix, array()); |
211 | return $r; | |
e501603b TO |
212 | } |
213 | } |