3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Member/MembershipLog.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:9182bcbeed0a05c3fed5f3027ba89668)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Member_DAO_MembershipLog constructor.
40 class CRM_Member_DAO_MembershipLog
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_membership_log';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * FK to Membership table
63 public $membership_id;
65 * New status assigned to membership by this action. FK to Membership Status
71 * New membership period start date
77 * New membership period expiration date.
83 * FK to Contact ID of person under whose credentials this data modification was made.
89 * Date this membership modification action was logged.
93 public $modified_date;
95 * FK to Membership Type.
99 public $membership_type_id;
101 * Maximum number of related memberships.
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') ,
143 'table_name' => 'civicrm_membership_log',
144 'entity' => 'MembershipLog',
145 'bao' => 'CRM_Member_BAO_MembershipLog',
147 'membership_id' => array(
148 'name' => 'membership_id',
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('Membership ID') ,
151 'description' => 'FK to Membership table',
153 'table_name' => 'civicrm_membership_log',
154 'entity' => 'MembershipLog',
155 'bao' => 'CRM_Member_BAO_MembershipLog',
156 'FKClassName' => 'CRM_Member_DAO_Membership',
158 'status_id' => array(
159 'name' => 'status_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Membership Status') ,
162 'description' => 'New status assigned to membership by this action. FK to Membership Status',
164 'table_name' => 'civicrm_membership_log',
165 'entity' => 'MembershipLog',
166 'bao' => 'CRM_Member_BAO_MembershipLog',
167 'FKClassName' => 'CRM_Member_DAO_MembershipStatus',
169 'start_date' => array(
170 'name' => 'start_date',
171 'type' => CRM_Utils_Type
::T_DATE
,
172 'title' => ts('Membership Log Start Date') ,
173 'description' => 'New membership period start date',
174 'table_name' => 'civicrm_membership_log',
175 'entity' => 'MembershipLog',
176 'bao' => 'CRM_Member_BAO_MembershipLog',
179 'name' => 'end_date',
180 'type' => CRM_Utils_Type
::T_DATE
,
181 'title' => ts('Membership Log End Date') ,
182 'description' => 'New membership period expiration date.',
183 'table_name' => 'civicrm_membership_log',
184 'entity' => 'MembershipLog',
185 'bao' => 'CRM_Member_BAO_MembershipLog',
187 'modified_id' => array(
188 'name' => 'modified_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Membership Log modified By') ,
191 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
192 'table_name' => 'civicrm_membership_log',
193 'entity' => 'MembershipLog',
194 'bao' => 'CRM_Member_BAO_MembershipLog',
195 'FKClassName' => 'CRM_Contact_DAO_Contact',
197 'modified_date' => array(
198 'name' => 'modified_date',
199 'type' => CRM_Utils_Type
::T_DATE
,
200 'title' => ts('Membership Change Date') ,
201 'description' => 'Date this membership modification action was logged.',
202 'table_name' => 'civicrm_membership_log',
203 'entity' => 'MembershipLog',
204 'bao' => 'CRM_Member_BAO_MembershipLog',
206 'membership_type_id' => array(
207 'name' => 'membership_type_id',
208 'type' => CRM_Utils_Type
::T_INT
,
209 'title' => ts('Membership Type ID') ,
210 'description' => 'FK to Membership Type.',
211 'table_name' => 'civicrm_membership_log',
212 'entity' => 'MembershipLog',
213 'bao' => 'CRM_Member_BAO_MembershipLog',
214 'FKClassName' => 'CRM_Member_DAO_MembershipType',
216 'max_related' => array(
217 'name' => 'max_related',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Maximum Related Memberships') ,
220 'description' => 'Maximum number of related memberships.',
221 'table_name' => 'civicrm_membership_log',
222 'entity' => 'MembershipLog',
223 'bao' => 'CRM_Member_BAO_MembershipLog',
226 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
228 return Civi
::$statics[__CLASS__
]['fields'];
231 * Return a mapping from field-name to the corresponding key (as used in fields()).
234 * Array(string $name => string $uniqueName).
236 static function &fieldKeys() {
237 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
238 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
240 return Civi
::$statics[__CLASS__
]['fieldKeys'];
243 * Returns the names of this table
247 static function getTableName() {
248 return self
::$_tableName;
251 * Returns if this table needs to be logged
259 * Returns the list of fields that can be imported
261 * @param bool $prefix
265 static function &import($prefix = false) {
266 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_log', $prefix, array());
270 * Returns the list of fields that can be exported
272 * @param bool $prefix
276 static function &export($prefix = false) {
277 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_log', $prefix, array());