CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Core / DAO / Extension.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/Extension.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 33 * (GenCodeChecksum:fdbe27f0b1587c2b4806d98f474e78ed)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_Extension constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_Extension extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_extension';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Local Extension ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 *
61 * @var string
62 */
63 public $type;
64 /**
65 * Fully qualified extension name
66 *
67 * @var string
68 */
69 public $full_name;
70 /**
71 * Short name
72 *
73 * @var string
74 */
75 public $name;
76 /**
77 * Short, printable name
78 *
79 * @var string
80 */
81 public $label;
82 /**
83 * Primary PHP file
84 *
85 * @var string
86 */
87 public $file;
88 /**
89 * Revision code of the database schema; the format is module-defined
90 *
91 * @var string
92 */
93 public $schema_version;
94 /**
95 * Is this extension active?
96 *
97 * @var boolean
98 */
99 public $is_active;
100 /**
f41f0342 101 * Class constructor.
e501603b
TO
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,
522a26c9 121 'table_name' => 'civicrm_extension',
122 'entity' => 'Extension',
123 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 124 'localizable' => 0,
e501603b
TO
125 ) ,
126 'type' => array(
127 'name' => 'type',
128 'type' => CRM_Utils_Type::T_STRING,
129 'title' => ts('Type') ,
130 'required' => true,
131 'maxlength' => 8,
132 'size' => CRM_Utils_Type::EIGHT,
522a26c9 133 'table_name' => 'civicrm_extension',
134 'entity' => 'Extension',
135 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 136 'localizable' => 0,
e501603b
TO
137 'html' => array(
138 'type' => 'Select',
139 ) ,
140 'pseudoconstant' => array(
141 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
142 )
143 ) ,
144 'full_name' => array(
145 'name' => 'full_name',
146 'type' => CRM_Utils_Type::T_STRING,
147 'title' => ts('Key') ,
148 'description' => 'Fully qualified extension name',
149 'required' => true,
150 'maxlength' => 255,
151 'size' => CRM_Utils_Type::HUGE,
522a26c9 152 'table_name' => 'civicrm_extension',
153 'entity' => 'Extension',
154 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 155 'localizable' => 0,
e501603b
TO
156 ) ,
157 'name' => array(
158 'name' => 'name',
159 'type' => CRM_Utils_Type::T_STRING,
160 'title' => ts('Name') ,
161 'description' => 'Short name',
162 'maxlength' => 255,
163 'size' => CRM_Utils_Type::HUGE,
164 'import' => true,
165 'where' => 'civicrm_extension.name',
166 'headerPattern' => '',
167 'dataPattern' => '',
168 'export' => true,
522a26c9 169 'table_name' => 'civicrm_extension',
170 'entity' => 'Extension',
171 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 172 'localizable' => 0,
e501603b
TO
173 ) ,
174 'label' => array(
175 'name' => 'label',
176 'type' => CRM_Utils_Type::T_STRING,
177 'title' => ts('Label') ,
178 'description' => 'Short, printable name',
179 'maxlength' => 255,
180 'size' => CRM_Utils_Type::HUGE,
181 'import' => true,
182 'where' => 'civicrm_extension.label',
183 'headerPattern' => '',
184 'dataPattern' => '',
185 'export' => true,
522a26c9 186 'table_name' => 'civicrm_extension',
187 'entity' => 'Extension',
188 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 189 'localizable' => 0,
e501603b
TO
190 ) ,
191 'file' => array(
192 'name' => 'file',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('File') ,
195 'description' => 'Primary PHP file',
196 'maxlength' => 255,
197 'size' => CRM_Utils_Type::HUGE,
198 'import' => true,
199 'where' => 'civicrm_extension.file',
200 'headerPattern' => '',
201 'dataPattern' => '',
202 'export' => true,
522a26c9 203 'table_name' => 'civicrm_extension',
204 'entity' => 'Extension',
205 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 206 'localizable' => 0,
e501603b
TO
207 ) ,
208 'schema_version' => array(
209 'name' => 'schema_version',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Schema Version') ,
212 'description' => 'Revision code of the database schema; the format is module-defined',
213 'maxlength' => 63,
214 'size' => CRM_Utils_Type::BIG,
215 'import' => true,
216 'where' => 'civicrm_extension.schema_version',
217 'headerPattern' => '',
218 'dataPattern' => '',
219 'export' => true,
522a26c9 220 'table_name' => 'civicrm_extension',
221 'entity' => 'Extension',
222 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 223 'localizable' => 0,
e501603b
TO
224 ) ,
225 'is_active' => array(
226 'name' => 'is_active',
227 'type' => CRM_Utils_Type::T_BOOLEAN,
228 'title' => ts('Extension is Active?') ,
229 'description' => 'Is this extension active?',
230 'default' => '1',
522a26c9 231 'table_name' => 'civicrm_extension',
232 'entity' => 'Extension',
233 'bao' => 'CRM_Core_BAO_Extension',
6a7e5e5d 234 'localizable' => 0,
e501603b
TO
235 ) ,
236 );
346aaaba 237 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 238 }
346aaaba 239 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
240 }
241 /**
bd8e0b14 242 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
243 *
244 * @return array
bd8e0b14 245 * Array(string $name => string $uniqueName).
e501603b
TO
246 */
247 static function &fieldKeys() {
bd8e0b14
TO
248 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
249 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 250 }
bd8e0b14 251 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
252 }
253 /**
254 * Returns the names of this table
255 *
256 * @return string
257 */
258 static function getTableName() {
259 return self::$_tableName;
260 }
261 /**
262 * Returns if this table needs to be logged
263 *
264 * @return boolean
265 */
266 function getLog() {
267 return self::$_log;
268 }
269 /**
270 * Returns the list of fields that can be imported
271 *
272 * @param bool $prefix
273 *
274 * @return array
275 */
276 static function &import($prefix = false) {
60808919
TO
277 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'extension', $prefix, array());
278 return $r;
e501603b
TO
279 }
280 /**
281 * Returns the list of fields that can be exported
282 *
283 * @param bool $prefix
284 *
285 * @return array
286 */
287 static function &export($prefix = false) {
60808919
TO
288 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'extension', $prefix, array());
289 return $r;
e501603b
TO
290 }
291}