3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2015
31 * Generated from xml/schema/CRM/Member/MembershipLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Member_DAO_MembershipLog
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_membership_log';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
88 * FK to Membership table
92 public $membership_id;
94 * New status assigned to membership by this action. FK to Membership Status
100 * New membership period start date
106 * New membership period expiration date.
112 * FK to Contact ID of person under whose credentials this data modification was made.
118 * Date this membership modification action was logged.
122 public $modified_date;
124 * FK to Membership Type.
128 public $membership_type_id;
130 * Maximum number of related memberships.
138 * @return civicrm_membership_log
140 function __construct() {
141 $this->__table
= 'civicrm_membership_log';
142 parent
::__construct();
145 * Returns foreign keys and entity references
148 * [CRM_Core_Reference_Interface]
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');
158 return self
::$_links;
161 * Returns all the column names of this table
165 static function &fields() {
166 if (!(self
::$_fields)) {
167 self
::$_fields = array(
170 'type' => CRM_Utils_Type
::T_INT
,
173 'membership_id' => array(
174 'name' => 'membership_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'description' => 'FK to Membership table',
178 'FKClassName' => 'CRM_Member_DAO_Membership',
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',
186 'FKClassName' => 'CRM_Member_DAO_MembershipStatus',
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',
195 'name' => 'end_date',
196 'type' => CRM_Utils_Type
::T_DATE
,
197 'title' => ts('End Date') ,
198 'description' => 'New membership period expiration date.',
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',
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.',
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',
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.',
226 return self
::$_fields;
229 * Returns an array containing, for each field, the arary key used for that
230 * field in self::$_fields.
234 static function &fieldKeys() {
235 if (!(self
::$_fieldKeys)) {
236 self
::$_fieldKeys = array(
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',
248 return self
::$_fieldKeys;
251 * Returns the names of this table
255 static function getTableName() {
256 return self
::$_tableName;
259 * Returns if this table needs to be logged
267 * Returns the list of fields that can be imported
269 * @param bool $prefix
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)) {
280 self
::$_import['membership_log'] = & $fields[$name];
282 self
::$_import[$name] = & $fields[$name];
287 return self
::$_import;
290 * Returns the list of fields that can be exported
292 * @param bool $prefix
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)) {
303 self
::$_export['membership_log'] = & $fields[$name];
305 self
::$_export[$name] = & $fields[$name];
310 return self
::$_export;