3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Member/MembershipLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0c51f7b8ad368df053d1345e0a20d33a)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Member_DAO_MembershipLog
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_membership_log';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
57 * FK to Membership table
61 public $membership_id;
63 * New status assigned to membership by this action. FK to Membership Status
69 * New membership period start date
75 * New membership period expiration date.
81 * FK to Contact ID of person under whose credentials this data modification was made.
87 * Date this membership modification action was logged.
91 public $modified_date;
93 * FK to Membership Type.
97 public $membership_type_id;
99 * Maximum number of related memberships.
107 * @return civicrm_membership_log
109 function __construct() {
110 $this->__table
= 'civicrm_membership_log';
111 parent
::__construct();
114 * Returns foreign keys and entity references
117 * [CRM_Core_Reference_Interface]
119 static function getReferenceColumns() {
120 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
121 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
122 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_id', 'civicrm_membership', 'id');
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'status_id', 'civicrm_membership_status', 'id');
124 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'membership_type_id', 'civicrm_membership_type', 'id');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
131 * Returns all the column names of this table
135 static function &fields() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
137 Civi
::$statics[__CLASS__
]['fields'] = array(
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Membership Log ID') ,
144 'membership_id' => array(
145 'name' => 'membership_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Membership ID') ,
148 'description' => 'FK to Membership table',
150 'FKClassName' => 'CRM_Member_DAO_Membership',
152 'status_id' => array(
153 'name' => 'status_id',
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Membership Status') ,
156 'description' => 'New status assigned to membership by this action. FK to Membership Status',
158 'FKClassName' => 'CRM_Member_DAO_MembershipStatus',
160 'start_date' => array(
161 'name' => 'start_date',
162 'type' => CRM_Utils_Type
::T_DATE
,
163 'title' => ts('Membership Log Start Date') ,
164 'description' => 'New membership period start date',
167 'name' => 'end_date',
168 'type' => CRM_Utils_Type
::T_DATE
,
169 'title' => ts('Membership Log End Date') ,
170 'description' => 'New membership period expiration date.',
172 'modified_id' => array(
173 'name' => 'modified_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Membership Log modified By') ,
176 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
177 'FKClassName' => 'CRM_Contact_DAO_Contact',
179 'modified_date' => array(
180 'name' => 'modified_date',
181 'type' => CRM_Utils_Type
::T_DATE
,
182 'title' => ts('Membership Change Date') ,
183 'description' => 'Date this membership modification action was logged.',
185 'membership_type_id' => array(
186 'name' => 'membership_type_id',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('Membership Type ID') ,
189 'description' => 'FK to Membership Type.',
190 'FKClassName' => 'CRM_Member_DAO_MembershipType',
192 'max_related' => array(
193 'name' => 'max_related',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Maximum Related Memberships') ,
196 'description' => 'Maximum number of related memberships.',
199 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
201 return Civi
::$statics[__CLASS__
]['fields'];
204 * Return a mapping from field-name to the corresponding key (as used in fields()).
207 * Array(string $name => string $uniqueName).
209 static function &fieldKeys() {
210 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
211 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
213 return Civi
::$statics[__CLASS__
]['fieldKeys'];
216 * Returns the names of this table
220 static function getTableName() {
221 return self
::$_tableName;
224 * Returns if this table needs to be logged
232 * Returns the list of fields that can be imported
234 * @param bool $prefix
238 static function &import($prefix = false) {
239 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_log', $prefix, array());
243 * Returns the list of fields that can be exported
245 * @param bool $prefix
249 static function &export($prefix = false) {
250 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_log', $prefix, array());