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/Batch/Batch.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:a9d49cd47b4a388ca88aa2af363f952d)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Batch_DAO_Batch constructor.
40 class CRM_Batch_DAO_Batch
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_batch';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Variable name/programmatic handle for this batch.
72 * Description of this batch set.
84 * When was this item created
96 * When was this item created
100 public $modified_date;
102 * FK to Saved Search ID
106 public $saved_search_id;
108 * fk to Batch Status options in civicrm_option_values
114 * fk to Batch Type options in civicrm_option_values
120 * fk to Batch mode options in civicrm_option_values
126 * Total amount for this batch.
132 * Number of items in a batch.
138 * fk to Payment Instrument options in civicrm_option_values
142 public $payment_instrument_id;
147 public $exported_date;
157 function __construct() {
158 $this->__table
= 'civicrm_batch';
159 parent
::__construct();
162 * Returns foreign keys and entity references.
165 * [CRM_Core_Reference_Interface]
167 static function getReferenceColumns() {
168 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
169 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
170 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
171 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
172 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
173 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
175 return Civi
::$statics[__CLASS__
]['links'];
178 * Returns all the column names of this table
182 static function &fields() {
183 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
184 Civi
::$statics[__CLASS__
]['fields'] = array(
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('Batch ID') ,
189 'description' => 'Unique Address ID',
191 'table_name' => 'civicrm_batch',
193 'bao' => 'CRM_Batch_BAO_Batch',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Batch Name') ,
200 'description' => 'Variable name/programmatic handle for this batch.',
202 'size' => CRM_Utils_Type
::BIG
,
203 'table_name' => 'civicrm_batch',
205 'bao' => 'CRM_Batch_BAO_Batch',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Batch Title') ,
215 'description' => 'Friendly Name.',
217 'size' => CRM_Utils_Type
::HUGE
,
218 'table_name' => 'civicrm_batch',
220 'bao' => 'CRM_Batch_BAO_Batch',
226 'description' => array(
227 'name' => 'description',
228 'type' => CRM_Utils_Type
::T_TEXT
,
229 'title' => ts('Batch Description') ,
230 'description' => 'Description of this batch set.',
233 'table_name' => 'civicrm_batch',
235 'bao' => 'CRM_Batch_BAO_Batch',
238 'type' => 'TextArea',
241 'created_id' => array(
242 'name' => 'created_id',
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Batch Created By') ,
245 'description' => 'FK to Contact ID',
246 'table_name' => 'civicrm_batch',
248 'bao' => 'CRM_Batch_BAO_Batch',
250 'FKClassName' => 'CRM_Contact_DAO_Contact',
252 'created_date' => array(
253 'name' => 'created_date',
254 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
255 'title' => ts('Batch Created Date') ,
256 'description' => 'When was this item created',
257 'table_name' => 'civicrm_batch',
259 'bao' => 'CRM_Batch_BAO_Batch',
262 'type' => 'Select Date',
265 'modified_id' => array(
266 'name' => 'modified_id',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('Batch Modified By') ,
269 'description' => 'FK to Contact ID',
270 'table_name' => 'civicrm_batch',
272 'bao' => 'CRM_Batch_BAO_Batch',
274 'FKClassName' => 'CRM_Contact_DAO_Contact',
276 'modified_date' => array(
277 'name' => 'modified_date',
278 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
279 'title' => ts('Batch Modified Date') ,
280 'description' => 'When was this item created',
281 'table_name' => 'civicrm_batch',
283 'bao' => 'CRM_Batch_BAO_Batch',
286 'saved_search_id' => array(
287 'name' => 'saved_search_id',
288 'type' => CRM_Utils_Type
::T_INT
,
289 'title' => ts('Batch Smart Group') ,
290 'description' => 'FK to Saved Search ID',
291 'table_name' => 'civicrm_batch',
293 'bao' => 'CRM_Batch_BAO_Batch',
295 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
297 'type' => 'EntityRef',
300 'status_id' => array(
301 'name' => 'status_id',
302 'type' => CRM_Utils_Type
::T_INT
,
303 'title' => ts('Batch Status') ,
304 'description' => 'fk to Batch Status options in civicrm_option_values',
306 'table_name' => 'civicrm_batch',
308 'bao' => 'CRM_Batch_BAO_Batch',
313 'pseudoconstant' => array(
314 'optionGroupName' => 'batch_status',
315 'optionEditPath' => 'civicrm/admin/options/batch_status',
320 'type' => CRM_Utils_Type
::T_INT
,
321 'title' => ts('Batch Type') ,
322 'description' => 'fk to Batch Type options in civicrm_option_values',
323 'table_name' => 'civicrm_batch',
325 'bao' => 'CRM_Batch_BAO_Batch',
330 'pseudoconstant' => array(
331 'optionGroupName' => 'batch_type',
332 'optionEditPath' => 'civicrm/admin/options/batch_type',
337 'type' => CRM_Utils_Type
::T_INT
,
338 'title' => ts('Batch Mode') ,
339 'description' => 'fk to Batch mode options in civicrm_option_values',
340 'table_name' => 'civicrm_batch',
342 'bao' => 'CRM_Batch_BAO_Batch',
347 'pseudoconstant' => array(
348 'optionGroupName' => 'batch_mode',
349 'optionEditPath' => 'civicrm/admin/options/batch_mode',
354 'type' => CRM_Utils_Type
::T_MONEY
,
355 'title' => ts('Batch Total') ,
356 'description' => 'Total amount for this batch.',
357 'precision' => array(
361 'table_name' => 'civicrm_batch',
363 'bao' => 'CRM_Batch_BAO_Batch',
369 'item_count' => array(
370 'name' => 'item_count',
371 'type' => CRM_Utils_Type
::T_INT
,
372 'title' => ts('Batch Number of Items') ,
373 'description' => 'Number of items in a batch.',
374 'table_name' => 'civicrm_batch',
376 'bao' => 'CRM_Batch_BAO_Batch',
382 'payment_instrument_id' => array(
383 'name' => 'payment_instrument_id',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Batch Payment Method') ,
386 'description' => 'fk to Payment Instrument options in civicrm_option_values',
387 'table_name' => 'civicrm_batch',
389 'bao' => 'CRM_Batch_BAO_Batch',
394 'pseudoconstant' => array(
395 'optionGroupName' => 'payment_instrument',
396 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
399 'exported_date' => array(
400 'name' => 'exported_date',
401 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
402 'title' => ts('Batch Exported Date') ,
403 'table_name' => 'civicrm_batch',
405 'bao' => 'CRM_Batch_BAO_Batch',
410 'type' => CRM_Utils_Type
::T_LONGTEXT
,
411 'title' => ts('Batch Data') ,
412 'description' => 'cache entered data',
413 'table_name' => 'civicrm_batch',
415 'bao' => 'CRM_Batch_BAO_Batch',
419 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
421 return Civi
::$statics[__CLASS__
]['fields'];
424 * Return a mapping from field-name to the corresponding key (as used in fields()).
427 * Array(string $name => string $uniqueName).
429 static function &fieldKeys() {
430 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
431 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
433 return Civi
::$statics[__CLASS__
]['fieldKeys'];
436 * Returns the names of this table
440 static function getTableName() {
441 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
444 * Returns if this table needs to be logged
452 * Returns the list of fields that can be imported
454 * @param bool $prefix
458 static function &import($prefix = false) {
459 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'batch', $prefix, array());
463 * Returns the list of fields that can be exported
465 * @param bool $prefix
469 static function &export($prefix = false) {
470 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'batch', $prefix, array());
474 * Returns the list of indices
476 public static function indices($localize = TRUE) {
483 'localizable' => false,
485 'sig' => 'civicrm_batch::1::name',
488 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;