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',
148 'membership_id' => array(
149 'name' => 'membership_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Membership ID') ,
152 'description' => 'FK to Membership table',
154 'table_name' => 'civicrm_membership_log',
155 'entity' => 'MembershipLog',
156 'bao' => 'CRM_Member_BAO_MembershipLog',
158 'FKClassName' => 'CRM_Member_DAO_Membership',
160 'status_id' => array(
161 'name' => 'status_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('Membership Status') ,
164 'description' => 'New status assigned to membership by this action. FK to Membership Status',
166 'table_name' => 'civicrm_membership_log',
167 'entity' => 'MembershipLog',
168 'bao' => 'CRM_Member_BAO_MembershipLog',
170 'FKClassName' => 'CRM_Member_DAO_MembershipStatus',
172 'start_date' => array(
173 'name' => 'start_date',
174 'type' => CRM_Utils_Type
::T_DATE
,
175 'title' => ts('Membership Log Start Date') ,
176 'description' => 'New membership period start date',
177 'table_name' => 'civicrm_membership_log',
178 'entity' => 'MembershipLog',
179 'bao' => 'CRM_Member_BAO_MembershipLog',
183 'name' => 'end_date',
184 'type' => CRM_Utils_Type
::T_DATE
,
185 'title' => ts('Membership Log End Date') ,
186 'description' => 'New membership period expiration date.',
187 'table_name' => 'civicrm_membership_log',
188 'entity' => 'MembershipLog',
189 'bao' => 'CRM_Member_BAO_MembershipLog',
192 'modified_id' => array(
193 'name' => 'modified_id',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Membership Log modified By') ,
196 'description' => 'FK to Contact ID of person under whose credentials this data modification was made.',
197 'table_name' => 'civicrm_membership_log',
198 'entity' => 'MembershipLog',
199 'bao' => 'CRM_Member_BAO_MembershipLog',
201 'FKClassName' => 'CRM_Contact_DAO_Contact',
203 'modified_date' => array(
204 'name' => 'modified_date',
205 'type' => CRM_Utils_Type
::T_DATE
,
206 'title' => ts('Membership Change Date') ,
207 'description' => 'Date this membership modification action was logged.',
208 'table_name' => 'civicrm_membership_log',
209 'entity' => 'MembershipLog',
210 'bao' => 'CRM_Member_BAO_MembershipLog',
213 'membership_type_id' => array(
214 'name' => 'membership_type_id',
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Membership Type ID') ,
217 'description' => 'FK to Membership Type.',
218 'table_name' => 'civicrm_membership_log',
219 'entity' => 'MembershipLog',
220 'bao' => 'CRM_Member_BAO_MembershipLog',
222 'FKClassName' => 'CRM_Member_DAO_MembershipType',
224 'max_related' => array(
225 'name' => 'max_related',
226 'type' => CRM_Utils_Type
::T_INT
,
227 'title' => ts('Maximum Related Memberships') ,
228 'description' => 'Maximum number of related memberships.',
229 'table_name' => 'civicrm_membership_log',
230 'entity' => 'MembershipLog',
231 'bao' => 'CRM_Member_BAO_MembershipLog',
235 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
237 return Civi
::$statics[__CLASS__
]['fields'];
240 * Return a mapping from field-name to the corresponding key (as used in fields()).
243 * Array(string $name => string $uniqueName).
245 static function &fieldKeys() {
246 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
247 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
249 return Civi
::$statics[__CLASS__
]['fieldKeys'];
252 * Returns the names of this table
256 static function getTableName() {
257 return self
::$_tableName;
260 * Returns if this table needs to be logged
268 * Returns the list of fields that can be imported
270 * @param bool $prefix
274 static function &import($prefix = false) {
275 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'membership_log', $prefix, array());
279 * Returns the list of fields that can be exported
281 * @param bool $prefix
285 static function &export($prefix = false) {
286 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'membership_log', $prefix, array());
290 * Returns the list of indices
292 public static function indices($localize = TRUE) {
294 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;