commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Core / DAO / Component.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
30 *
31 * Generated from xml/schema/CRM/Core/Component.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_Component extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_component';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = false;
82 /**
83 * Component ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Name of the component.
90 *
91 * @var string
92 */
93 public $name;
94 /**
95 * Path to components main directory in a form of a class
96 namespace.
97 *
98 * @var string
99 */
100 public $namespace;
101 /**
102 * class constructor
103 *
104 * @return civicrm_component
105 */
106 function __construct() {
107 $this->__table = 'civicrm_component';
108 parent::__construct();
109 }
110 /**
111 * Returns all the column names of this table
112 *
113 * @return array
114 */
115 static function &fields() {
116 if (!(self::$_fields)) {
117 self::$_fields = array(
118 'id' => array(
119 'name' => 'id',
120 'type' => CRM_Utils_Type::T_INT,
121 'description' => 'Component ID',
122 'required' => true,
123 ) ,
124 'name' => array(
125 'name' => 'name',
126 'type' => CRM_Utils_Type::T_STRING,
127 'title' => ts('Component name') ,
128 'description' => 'Name of the component.',
129 'required' => true,
130 'maxlength' => 64,
131 'size' => CRM_Utils_Type::BIG,
132 ) ,
133 'namespace' => array(
134 'name' => 'namespace',
135 'type' => CRM_Utils_Type::T_STRING,
136 'title' => ts('Namespace reserved for component.') ,
137 'description' => 'Path to components main directory in a form of a class
138 namespace.
139 ',
140 'maxlength' => 128,
141 'size' => CRM_Utils_Type::HUGE,
142 ) ,
143 );
144 }
145 return self::$_fields;
146 }
147 /**
148 * Returns an array containing, for each field, the arary key used for that
149 * field in self::$_fields.
150 *
151 * @return array
152 */
153 static function &fieldKeys() {
154 if (!(self::$_fieldKeys)) {
155 self::$_fieldKeys = array(
156 'id' => 'id',
157 'name' => 'name',
158 'namespace' => 'namespace',
159 );
160 }
161 return self::$_fieldKeys;
162 }
163 /**
164 * Returns the names of this table
165 *
166 * @return string
167 */
168 static function getTableName() {
169 return self::$_tableName;
170 }
171 /**
172 * Returns if this table needs to be logged
173 *
174 * @return boolean
175 */
176 function getLog() {
177 return self::$_log;
178 }
179 /**
180 * Returns the list of fields that can be imported
181 *
182 * @param bool $prefix
183 *
184 * @return array
185 */
186 static function &import($prefix = false) {
187 if (!(self::$_import)) {
188 self::$_import = array();
189 $fields = self::fields();
190 foreach($fields as $name => $field) {
191 if (CRM_Utils_Array::value('import', $field)) {
192 if ($prefix) {
193 self::$_import['component'] = & $fields[$name];
194 } else {
195 self::$_import[$name] = & $fields[$name];
196 }
197 }
198 }
199 }
200 return self::$_import;
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) {
210 if (!(self::$_export)) {
211 self::$_export = array();
212 $fields = self::fields();
213 foreach($fields as $name => $field) {
214 if (CRM_Utils_Array::value('export', $field)) {
215 if ($prefix) {
216 self::$_export['component'] = & $fields[$name];
217 } else {
218 self::$_export[$name] = & $fields[$name];
219 }
220 }
221 }
222 }
223 return self::$_export;
224 }
225 }