commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Member / DAO / MembershipLog.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/Member/MembershipLog.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_Member_DAO_MembershipLog extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_membership_log';
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 = true;
82 /**
83 *
84 * @var int unsigned
85 */
86 public $id;
87 /**
88 * FK to Membership table
89 *
90 * @var int unsigned
91 */
92 public $membership_id;
93 /**
94 * New status assigned to membership by this action. FK to Membership Status
95 *
96 * @var int unsigned
97 */
98 public $status_id;
99 /**
100 * New membership period start date
101 *
102 * @var date
103 */
104 public $start_date;
105 /**
106 * New membership period expiration date.
107 *
108 * @var date
109 */
110 public $end_date;
111 /**
112 * FK to Contact ID of person under whose credentials this data modification was made.
113 *
114 * @var int unsigned
115 */
116 public $modified_id;
117 /**
118 * Date this membership modification action was logged.
119 *
120 * @var date
121 */
122 public $modified_date;
123 /**
124 * FK to Membership Type.
125 *
126 * @var int unsigned
127 */
128 public $membership_type_id;
129 /**
130 * Maximum number of related memberships.
131 *
132 * @var int
133 */
134 public $max_related;
135 /**
136 * class constructor
137 *
138 * @return civicrm_membership_log
139 */
140 function __construct() {
141 $this->__table = 'civicrm_membership_log';
142 parent::__construct();
143 }
144 /**
145 * Returns foreign keys and entity references
146 *
147 * @return array
148 * [CRM_Core_Reference_Interface]
149 */
150 static function getReferenceColumns() {
151 if (!self::$_links) {
152 self::$_links = static ::createReferenceColumns(__CLASS__);
153 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_id', 'civicrm_membership', 'id');
154 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'status_id', 'civicrm_membership_status', 'id');
155 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
156 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id');
157 }
158 return self::$_links;
159 }
160 /**
161 * Returns all the column names of this table
162 *
163 * @return array
164 */
165 static function &fields() {
166 if (!(self::$_fields)) {
167 self::$_fields = array(
168 'id' => array(
169 'name' => 'id',
170 'type' => CRM_Utils_Type::T_INT,
171 'required' => true,
172 ) ,
173 'membership_id' => array(
174 'name' => 'membership_id',
175 'type' => CRM_Utils_Type::T_INT,
176 'description' => 'FK to Membership table',
177 'required' => true,
178 'FKClassName' => 'CRM_Member_DAO_Membership',
179 ) ,
180 'status_id' => array(
181 'name' => 'status_id',
182 'type' => CRM_Utils_Type::T_INT,
183 'title' => ts('Membership Status') ,
184 'description' => 'New status assigned to membership by this action. FK to Membership Status',
185 'required' => true,
186 'FKClassName' => 'CRM_Member_DAO_MembershipStatus',
187 ) ,
188 'start_date' => array(
189 'name' => 'start_date',
190 'type' => CRM_Utils_Type::T_DATE,
191 'title' => ts('Start Date') ,
192 'description' => 'New membership period start date',
193 ) ,
194 'end_date' => array(
195 'name' => 'end_date',
196 'type' => CRM_Utils_Type::T_DATE,
197 'title' => ts('End Date') ,
198 'description' => 'New membership period expiration date.',
199 ) ,
200 'modified_id' => array(
201 'name' => 'modified_id',
202 'type' => CRM_Utils_Type::T_INT,
203 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
204 'FKClassName' => 'CRM_Contact_DAO_Contact',
205 ) ,
206 'modified_date' => array(
207 'name' => 'modified_date',
208 'type' => CRM_Utils_Type::T_DATE,
209 'title' => ts('Membership Change Date') ,
210 'description' => 'Date this membership modification action was logged.',
211 ) ,
212 'membership_type_id' => array(
213 'name' => 'membership_type_id',
214 'type' => CRM_Utils_Type::T_INT,
215 'description' => 'FK to Membership Type.',
216 'FKClassName' => 'CRM_Member_DAO_MembershipType',
217 ) ,
218 'max_related' => array(
219 'name' => 'max_related',
220 'type' => CRM_Utils_Type::T_INT,
221 'title' => ts('Max Related') ,
222 'description' => 'Maximum number of related memberships.',
223 ) ,
224 );
225 }
226 return self::$_fields;
227 }
228 /**
229 * Returns an array containing, for each field, the arary key used for that
230 * field in self::$_fields.
231 *
232 * @return array
233 */
234 static function &fieldKeys() {
235 if (!(self::$_fieldKeys)) {
236 self::$_fieldKeys = array(
237 'id' => 'id',
238 'membership_id' => 'membership_id',
239 'status_id' => 'status_id',
240 'start_date' => 'start_date',
241 'end_date' => 'end_date',
242 'modified_id' => 'modified_id',
243 'modified_date' => 'modified_date',
244 'membership_type_id' => 'membership_type_id',
245 'max_related' => 'max_related',
246 );
247 }
248 return self::$_fieldKeys;
249 }
250 /**
251 * Returns the names of this table
252 *
253 * @return string
254 */
255 static function getTableName() {
256 return self::$_tableName;
257 }
258 /**
259 * Returns if this table needs to be logged
260 *
261 * @return boolean
262 */
263 function getLog() {
264 return self::$_log;
265 }
266 /**
267 * Returns the list of fields that can be imported
268 *
269 * @param bool $prefix
270 *
271 * @return array
272 */
273 static function &import($prefix = false) {
274 if (!(self::$_import)) {
275 self::$_import = array();
276 $fields = self::fields();
277 foreach($fields as $name => $field) {
278 if (CRM_Utils_Array::value('import', $field)) {
279 if ($prefix) {
280 self::$_import['membership_log'] = & $fields[$name];
281 } else {
282 self::$_import[$name] = & $fields[$name];
283 }
284 }
285 }
286 }
287 return self::$_import;
288 }
289 /**
290 * Returns the list of fields that can be exported
291 *
292 * @param bool $prefix
293 *
294 * @return array
295 */
296 static function &export($prefix = false) {
297 if (!(self::$_export)) {
298 self::$_export = array();
299 $fields = self::fields();
300 foreach($fields as $name => $field) {
301 if (CRM_Utils_Array::value('export', $field)) {
302 if ($prefix) {
303 self::$_export['membership_log'] = & $fields[$name];
304 } else {
305 self::$_export[$name] = & $fields[$name];
306 }
307 }
308 }
309 }
310 return self::$_export;
311 }
312 }