Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
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 | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Member/MembershipLog.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
522a26c9 | 33 | * (GenCodeChecksum:aa569c9888f34d402e688ef7d6fdb88c) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Member_DAO_MembershipLog constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Member_DAO_MembershipLog extends CRM_Core_DAO { |
41 | /** | |
f41f0342 | 42 | * Static instance to hold the table name. |
e501603b TO |
43 | * |
44 | * @var string | |
45 | */ | |
46 | static $_tableName = 'civicrm_membership_log'; | |
e501603b | 47 | /** |
f41f0342 | 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b TO |
49 | * |
50 | * @var boolean | |
51 | */ | |
52 | static $_log = true; | |
53 | /** | |
54 | * | |
55 | * @var int unsigned | |
56 | */ | |
57 | public $id; | |
58 | /** | |
59 | * FK to Membership table | |
60 | * | |
61 | * @var int unsigned | |
62 | */ | |
63 | public $membership_id; | |
64 | /** | |
65 | * New status assigned to membership by this action. FK to Membership Status | |
66 | * | |
67 | * @var int unsigned | |
68 | */ | |
69 | public $status_id; | |
70 | /** | |
71 | * New membership period start date | |
72 | * | |
73 | * @var date | |
74 | */ | |
75 | public $start_date; | |
76 | /** | |
77 | * New membership period expiration date. | |
78 | * | |
79 | * @var date | |
80 | */ | |
81 | public $end_date; | |
82 | /** | |
83 | * FK to Contact ID of person under whose credentials this data modification was made. | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $modified_id; | |
88 | /** | |
89 | * Date this membership modification action was logged. | |
90 | * | |
91 | * @var date | |
92 | */ | |
93 | public $modified_date; | |
94 | /** | |
95 | * FK to Membership Type. | |
96 | * | |
97 | * @var int unsigned | |
98 | */ | |
99 | public $membership_type_id; | |
100 | /** | |
101 | * Maximum number of related memberships. | |
102 | * | |
103 | * @var int | |
104 | */ | |
105 | public $max_related; | |
106 | /** | |
f41f0342 | 107 | * Class constructor. |
e501603b TO |
108 | */ |
109 | function __construct() { | |
110 | $this->__table = 'civicrm_membership_log'; | |
111 | parent::__construct(); | |
112 | } | |
113 | /** | |
f41f0342 | 114 | * Returns foreign keys and entity references. |
e501603b TO |
115 | * |
116 | * @return array | |
117 | * [CRM_Core_Reference_Interface] | |
118 | */ | |
119 | static function getReferenceColumns() { | |
346aaaba TO |
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']); | |
e501603b | 127 | } |
346aaaba | 128 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
129 | } |
130 | /** | |
131 | * Returns all the column names of this table | |
132 | * | |
133 | * @return array | |
134 | */ | |
135 | static function &fields() { | |
346aaaba TO |
136 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
137 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
138 | 'id' => array( |
139 | 'name' => 'id', | |
140 | 'type' => CRM_Utils_Type::T_INT, | |
141 | 'title' => ts('Membership Log ID') , | |
142 | 'required' => true, | |
522a26c9 | 143 | 'table_name' => 'civicrm_membership_log', |
144 | 'entity' => 'MembershipLog', | |
145 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
146 | ) , |
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', | |
152 | 'required' => true, | |
522a26c9 | 153 | 'table_name' => 'civicrm_membership_log', |
154 | 'entity' => 'MembershipLog', | |
155 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
156 | 'FKClassName' => 'CRM_Member_DAO_Membership', |
157 | ) , | |
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', | |
163 | 'required' => true, | |
522a26c9 | 164 | 'table_name' => 'civicrm_membership_log', |
165 | 'entity' => 'MembershipLog', | |
166 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
167 | 'FKClassName' => 'CRM_Member_DAO_MembershipStatus', |
168 | ) , | |
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', | |
522a26c9 | 174 | 'table_name' => 'civicrm_membership_log', |
175 | 'entity' => 'MembershipLog', | |
176 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
177 | ) , |
178 | 'end_date' => array( | |
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.', | |
522a26c9 | 183 | 'table_name' => 'civicrm_membership_log', |
184 | 'entity' => 'MembershipLog', | |
185 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
186 | ) , |
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.', | |
522a26c9 | 192 | 'table_name' => 'civicrm_membership_log', |
193 | 'entity' => 'MembershipLog', | |
194 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
195 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
196 | ) , | |
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.', | |
522a26c9 | 202 | 'table_name' => 'civicrm_membership_log', |
203 | 'entity' => 'MembershipLog', | |
204 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
205 | ) , |
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.', | |
522a26c9 | 211 | 'table_name' => 'civicrm_membership_log', |
212 | 'entity' => 'MembershipLog', | |
213 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
214 | 'FKClassName' => 'CRM_Member_DAO_MembershipType', |
215 | ) , | |
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.', | |
522a26c9 | 221 | 'table_name' => 'civicrm_membership_log', |
222 | 'entity' => 'MembershipLog', | |
223 | 'bao' => 'CRM_Member_BAO_MembershipLog', | |
e501603b TO |
224 | ) , |
225 | ); | |
346aaaba | 226 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 227 | } |
346aaaba | 228 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
229 | } |
230 | /** | |
bd8e0b14 | 231 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
232 | * |
233 | * @return array | |
bd8e0b14 | 234 | * Array(string $name => string $uniqueName). |
e501603b TO |
235 | */ |
236 | static function &fieldKeys() { | |
bd8e0b14 TO |
237 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
238 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 239 | } |
bd8e0b14 | 240 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
241 | } |
242 | /** | |
243 | * Returns the names of this table | |
244 | * | |
245 | * @return string | |
246 | */ | |
247 | static function getTableName() { | |
248 | return self::$_tableName; | |
249 | } | |
250 | /** | |
251 | * Returns if this table needs to be logged | |
252 | * | |
253 | * @return boolean | |
254 | */ | |
255 | function getLog() { | |
256 | return self::$_log; | |
257 | } | |
258 | /** | |
259 | * Returns the list of fields that can be imported | |
260 | * | |
261 | * @param bool $prefix | |
262 | * | |
263 | * @return array | |
264 | */ | |
265 | static function &import($prefix = false) { | |
60808919 TO |
266 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_log', $prefix, array()); |
267 | return $r; | |
e501603b TO |
268 | } |
269 | /** | |
270 | * Returns the list of fields that can be exported | |
271 | * | |
272 | * @param bool $prefix | |
273 | * | |
274 | * @return array | |
275 | */ | |
276 | static function &export($prefix = false) { | |
60808919 TO |
277 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_log', $prefix, array()); |
278 | return $r; | |
e501603b TO |
279 | } |
280 | } |