CRM-19925 Updated DAO files
[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
522a26c9 33 * (GenCodeChecksum:d6bfb607b63fda77d26266578ac330a8)
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',
e501603b
TO
124 ) ,
125 'type' => array(
126 'name' => 'type',
127 'type' => CRM_Utils_Type::T_STRING,
128 'title' => ts('Type') ,
129 'required' => true,
130 'maxlength' => 8,
131 'size' => CRM_Utils_Type::EIGHT,
522a26c9 132 'table_name' => 'civicrm_extension',
133 'entity' => 'Extension',
134 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
135 'html' => array(
136 'type' => 'Select',
137 ) ,
138 'pseudoconstant' => array(
139 'callback' => 'CRM_Core_SelectValues::getExtensionTypes',
140 )
141 ) ,
142 'full_name' => array(
143 'name' => 'full_name',
144 'type' => CRM_Utils_Type::T_STRING,
145 'title' => ts('Key') ,
146 'description' => 'Fully qualified extension name',
147 'required' => true,
148 'maxlength' => 255,
149 'size' => CRM_Utils_Type::HUGE,
522a26c9 150 'table_name' => 'civicrm_extension',
151 'entity' => 'Extension',
152 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
153 ) ,
154 'name' => array(
155 'name' => 'name',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('Name') ,
158 'description' => 'Short name',
159 'maxlength' => 255,
160 'size' => CRM_Utils_Type::HUGE,
161 'import' => true,
162 'where' => 'civicrm_extension.name',
163 'headerPattern' => '',
164 'dataPattern' => '',
165 'export' => true,
522a26c9 166 'table_name' => 'civicrm_extension',
167 'entity' => 'Extension',
168 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
169 ) ,
170 'label' => array(
171 'name' => 'label',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('Label') ,
174 'description' => 'Short, printable name',
175 'maxlength' => 255,
176 'size' => CRM_Utils_Type::HUGE,
177 'import' => true,
178 'where' => 'civicrm_extension.label',
179 'headerPattern' => '',
180 'dataPattern' => '',
181 'export' => true,
522a26c9 182 'table_name' => 'civicrm_extension',
183 'entity' => 'Extension',
184 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
185 ) ,
186 'file' => array(
187 'name' => 'file',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('File') ,
190 'description' => 'Primary PHP file',
191 'maxlength' => 255,
192 'size' => CRM_Utils_Type::HUGE,
193 'import' => true,
194 'where' => 'civicrm_extension.file',
195 'headerPattern' => '',
196 'dataPattern' => '',
197 'export' => true,
522a26c9 198 'table_name' => 'civicrm_extension',
199 'entity' => 'Extension',
200 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
201 ) ,
202 'schema_version' => array(
203 'name' => 'schema_version',
204 'type' => CRM_Utils_Type::T_STRING,
205 'title' => ts('Schema Version') ,
206 'description' => 'Revision code of the database schema; the format is module-defined',
207 'maxlength' => 63,
208 'size' => CRM_Utils_Type::BIG,
209 'import' => true,
210 'where' => 'civicrm_extension.schema_version',
211 'headerPattern' => '',
212 'dataPattern' => '',
213 'export' => true,
522a26c9 214 'table_name' => 'civicrm_extension',
215 'entity' => 'Extension',
216 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
217 ) ,
218 'is_active' => array(
219 'name' => 'is_active',
220 'type' => CRM_Utils_Type::T_BOOLEAN,
221 'title' => ts('Extension is Active?') ,
222 'description' => 'Is this extension active?',
223 'default' => '1',
522a26c9 224 'table_name' => 'civicrm_extension',
225 'entity' => 'Extension',
226 'bao' => 'CRM_Core_BAO_Extension',
e501603b
TO
227 ) ,
228 );
346aaaba 229 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 230 }
346aaaba 231 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
232 }
233 /**
bd8e0b14 234 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
235 *
236 * @return array
bd8e0b14 237 * Array(string $name => string $uniqueName).
e501603b
TO
238 */
239 static function &fieldKeys() {
bd8e0b14
TO
240 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
241 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 242 }
bd8e0b14 243 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
244 }
245 /**
246 * Returns the names of this table
247 *
248 * @return string
249 */
250 static function getTableName() {
251 return self::$_tableName;
252 }
253 /**
254 * Returns if this table needs to be logged
255 *
256 * @return boolean
257 */
258 function getLog() {
259 return self::$_log;
260 }
261 /**
262 * Returns the list of fields that can be imported
263 *
264 * @param bool $prefix
265 *
266 * @return array
267 */
268 static function &import($prefix = false) {
60808919
TO
269 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'extension', $prefix, array());
270 return $r;
e501603b
TO
271 }
272 /**
273 * Returns the list of fields that can be exported
274 *
275 * @param bool $prefix
276 *
277 * @return array
278 */
279 static function &export($prefix = false) {
60808919
TO
280 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'extension', $prefix, array());
281 return $r;
e501603b
TO
282 }
283}