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/Core/Extension.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:9f05903fb26f373b3f7715b2a5e90ce6) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Core_DAO_Extension extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_extension'; | |
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 | * Local Extension ID | |
53 | * | |
54 | * @var int unsigned | |
55 | */ | |
56 | public $id; | |
57 | /** | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | public $type; | |
62 | /** | |
63 | * Fully qualified extension name | |
64 | * | |
65 | * @var string | |
66 | */ | |
67 | public $full_name; | |
68 | /** | |
69 | * Short name | |
70 | * | |
71 | * @var string | |
72 | */ | |
73 | public $name; | |
74 | /** | |
75 | * Short, printable name | |
76 | * | |
77 | * @var string | |
78 | */ | |
79 | public $label; | |
80 | /** | |
81 | * Primary PHP file | |
82 | * | |
83 | * @var string | |
84 | */ | |
85 | public $file; | |
86 | /** | |
87 | * Revision code of the database schema; the format is module-defined | |
88 | * | |
89 | * @var string | |
90 | */ | |
91 | public $schema_version; | |
92 | /** | |
93 | * Is this extension active? | |
94 | * | |
95 | * @var boolean | |
96 | */ | |
97 | public $is_active; | |
98 | /** | |
99 | * class constructor | |
100 | * | |
101 | * @return civicrm_extension | |
102 | */ | |
103 | function __construct() { | |
104 | $this->__table = 'civicrm_extension'; | |
105 | parent::__construct(); | |
106 | } | |
107 | /** | |
108 | * Returns all the column names of this table | |
109 | * | |
110 | * @return array | |
111 | */ | |
112 | static function &fields() { | |
346aaaba TO |
113 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
114 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
115 | 'id' => array( |
116 | 'name' => 'id', | |
117 | 'type' => CRM_Utils_Type::T_INT, | |
118 | 'title' => ts('Extension ID') , | |
119 | 'description' => 'Local Extension ID', | |
120 | 'required' => true, | |
121 | ) , | |
122 | 'type' => array( | |
123 | 'name' => 'type', | |
124 | 'type' => CRM_Utils_Type::T_STRING, | |
125 | 'title' => ts('Type') , | |
126 | 'required' => true, | |
127 | 'maxlength' => 8, | |
128 | 'size' => CRM_Utils_Type::EIGHT, | |
129 | 'html' => array( | |
130 | 'type' => 'Select', | |
131 | ) , | |
132 | 'pseudoconstant' => array( | |
133 | 'callback' => 'CRM_Core_SelectValues::getExtensionTypes', | |
134 | ) | |
135 | ) , | |
136 | 'full_name' => array( | |
137 | 'name' => 'full_name', | |
138 | 'type' => CRM_Utils_Type::T_STRING, | |
139 | 'title' => ts('Key') , | |
140 | 'description' => 'Fully qualified extension name', | |
141 | 'required' => true, | |
142 | 'maxlength' => 255, | |
143 | 'size' => CRM_Utils_Type::HUGE, | |
144 | ) , | |
145 | 'name' => array( | |
146 | 'name' => 'name', | |
147 | 'type' => CRM_Utils_Type::T_STRING, | |
148 | 'title' => ts('Name') , | |
149 | 'description' => 'Short name', | |
150 | 'maxlength' => 255, | |
151 | 'size' => CRM_Utils_Type::HUGE, | |
152 | 'import' => true, | |
153 | 'where' => 'civicrm_extension.name', | |
154 | 'headerPattern' => '', | |
155 | 'dataPattern' => '', | |
156 | 'export' => true, | |
157 | ) , | |
158 | 'label' => array( | |
159 | 'name' => 'label', | |
160 | 'type' => CRM_Utils_Type::T_STRING, | |
161 | 'title' => ts('Label') , | |
162 | 'description' => 'Short, printable name', | |
163 | 'maxlength' => 255, | |
164 | 'size' => CRM_Utils_Type::HUGE, | |
165 | 'import' => true, | |
166 | 'where' => 'civicrm_extension.label', | |
167 | 'headerPattern' => '', | |
168 | 'dataPattern' => '', | |
169 | 'export' => true, | |
170 | ) , | |
171 | 'file' => array( | |
172 | 'name' => 'file', | |
173 | 'type' => CRM_Utils_Type::T_STRING, | |
174 | 'title' => ts('File') , | |
175 | 'description' => 'Primary PHP file', | |
176 | 'maxlength' => 255, | |
177 | 'size' => CRM_Utils_Type::HUGE, | |
178 | 'import' => true, | |
179 | 'where' => 'civicrm_extension.file', | |
180 | 'headerPattern' => '', | |
181 | 'dataPattern' => '', | |
182 | 'export' => true, | |
183 | ) , | |
184 | 'schema_version' => array( | |
185 | 'name' => 'schema_version', | |
186 | 'type' => CRM_Utils_Type::T_STRING, | |
187 | 'title' => ts('Schema Version') , | |
188 | 'description' => 'Revision code of the database schema; the format is module-defined', | |
189 | 'maxlength' => 63, | |
190 | 'size' => CRM_Utils_Type::BIG, | |
191 | 'import' => true, | |
192 | 'where' => 'civicrm_extension.schema_version', | |
193 | 'headerPattern' => '', | |
194 | 'dataPattern' => '', | |
195 | 'export' => true, | |
196 | ) , | |
197 | 'is_active' => array( | |
198 | 'name' => 'is_active', | |
199 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
200 | 'title' => ts('Extension is Active?') , | |
201 | 'description' => 'Is this extension active?', | |
202 | 'default' => '1', | |
203 | ) , | |
204 | ); | |
346aaaba | 205 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 206 | } |
346aaaba | 207 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
208 | } |
209 | /** | |
bd8e0b14 | 210 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
211 | * |
212 | * @return array | |
bd8e0b14 | 213 | * Array(string $name => string $uniqueName). |
e501603b TO |
214 | */ |
215 | static function &fieldKeys() { | |
bd8e0b14 TO |
216 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
217 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 218 | } |
bd8e0b14 | 219 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
220 | } |
221 | /** | |
222 | * Returns the names of this table | |
223 | * | |
224 | * @return string | |
225 | */ | |
226 | static function getTableName() { | |
227 | return self::$_tableName; | |
228 | } | |
229 | /** | |
230 | * Returns if this table needs to be logged | |
231 | * | |
232 | * @return boolean | |
233 | */ | |
234 | function getLog() { | |
235 | return self::$_log; | |
236 | } | |
237 | /** | |
238 | * Returns the list of fields that can be imported | |
239 | * | |
240 | * @param bool $prefix | |
241 | * | |
242 | * @return array | |
243 | */ | |
244 | static function &import($prefix = false) { | |
60808919 TO |
245 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'extension', $prefix, array()); |
246 | return $r; | |
e501603b TO |
247 | } |
248 | /** | |
249 | * Returns the list of fields that can be exported | |
250 | * | |
251 | * @param bool $prefix | |
252 | * | |
253 | * @return array | |
254 | */ | |
255 | static function &export($prefix = false) { | |
60808919 TO |
256 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'extension', $prefix, array()); |
257 | return $r; | |
e501603b TO |
258 | } |
259 | } |