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:28922d3acf09a4ad091212f1bfa78732)
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',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Batch Name') ,
199 'description' => 'Variable name/programmatic handle for this batch.',
201 'size' => CRM_Utils_Type
::BIG
,
202 'table_name' => 'civicrm_batch',
204 'bao' => 'CRM_Batch_BAO_Batch',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Batch Title') ,
213 'description' => 'Friendly Name.',
215 'size' => CRM_Utils_Type
::BIG
,
216 'table_name' => 'civicrm_batch',
218 'bao' => 'CRM_Batch_BAO_Batch',
223 'description' => array(
224 'name' => 'description',
225 'type' => CRM_Utils_Type
::T_TEXT
,
226 'title' => ts('Batch Description') ,
227 'description' => 'Description of this batch set.',
230 'table_name' => 'civicrm_batch',
232 'bao' => 'CRM_Batch_BAO_Batch',
234 'type' => 'TextArea',
237 'created_id' => array(
238 'name' => 'created_id',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Batch Created By') ,
241 'description' => 'FK to Contact ID',
242 'table_name' => 'civicrm_batch',
244 'bao' => 'CRM_Batch_BAO_Batch',
245 'FKClassName' => 'CRM_Contact_DAO_Contact',
247 'created_date' => array(
248 'name' => 'created_date',
249 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
250 'title' => ts('Batch Created Date') ,
251 'description' => 'When was this item created',
252 'table_name' => 'civicrm_batch',
254 'bao' => 'CRM_Batch_BAO_Batch',
256 'type' => 'Select Date',
259 'modified_id' => array(
260 'name' => 'modified_id',
261 'type' => CRM_Utils_Type
::T_INT
,
262 'title' => ts('Batch Modified By') ,
263 'description' => 'FK to Contact ID',
264 'table_name' => 'civicrm_batch',
266 'bao' => 'CRM_Batch_BAO_Batch',
267 'FKClassName' => 'CRM_Contact_DAO_Contact',
269 'modified_date' => array(
270 'name' => 'modified_date',
271 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
272 'title' => ts('Batch Modified Date') ,
273 'description' => 'When was this item created',
274 'table_name' => 'civicrm_batch',
276 'bao' => 'CRM_Batch_BAO_Batch',
278 'saved_search_id' => array(
279 'name' => 'saved_search_id',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Batch Smart Group') ,
282 'description' => 'FK to Saved Search ID',
283 'table_name' => 'civicrm_batch',
285 'bao' => 'CRM_Batch_BAO_Batch',
286 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
288 'type' => 'EntityRef',
291 'status_id' => array(
292 'name' => 'status_id',
293 'type' => CRM_Utils_Type
::T_INT
,
294 'title' => ts('Batch Status') ,
295 'description' => 'fk to Batch Status options in civicrm_option_values',
297 'table_name' => 'civicrm_batch',
299 'bao' => 'CRM_Batch_BAO_Batch',
303 'pseudoconstant' => array(
304 'optionGroupName' => 'batch_status',
305 'optionEditPath' => 'civicrm/admin/options/batch_status',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Batch Type') ,
312 'description' => 'fk to Batch Type options in civicrm_option_values',
313 'table_name' => 'civicrm_batch',
315 'bao' => 'CRM_Batch_BAO_Batch',
319 'pseudoconstant' => array(
320 'optionGroupName' => 'batch_type',
321 'optionEditPath' => 'civicrm/admin/options/batch_type',
326 'type' => CRM_Utils_Type
::T_INT
,
327 'title' => ts('Batch Mode') ,
328 'description' => 'fk to Batch mode options in civicrm_option_values',
329 'table_name' => 'civicrm_batch',
331 'bao' => 'CRM_Batch_BAO_Batch',
335 'pseudoconstant' => array(
336 'optionGroupName' => 'batch_mode',
337 'optionEditPath' => 'civicrm/admin/options/batch_mode',
342 'type' => CRM_Utils_Type
::T_MONEY
,
343 'title' => ts('Batch Total') ,
344 'description' => 'Total amount for this batch.',
345 'precision' => array(
349 'table_name' => 'civicrm_batch',
351 'bao' => 'CRM_Batch_BAO_Batch',
356 'item_count' => array(
357 'name' => 'item_count',
358 'type' => CRM_Utils_Type
::T_INT
,
359 'title' => ts('Batch Number of Items') ,
360 'description' => 'Number of items in a batch.',
361 'table_name' => 'civicrm_batch',
363 'bao' => 'CRM_Batch_BAO_Batch',
368 'payment_instrument_id' => array(
369 'name' => 'payment_instrument_id',
370 'type' => CRM_Utils_Type
::T_INT
,
371 'title' => ts('Batch Payment Method') ,
372 'description' => 'fk to Payment Instrument options in civicrm_option_values',
373 'table_name' => 'civicrm_batch',
375 'bao' => 'CRM_Batch_BAO_Batch',
379 'pseudoconstant' => array(
380 'optionGroupName' => 'payment_instrument',
381 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
384 'exported_date' => array(
385 'name' => 'exported_date',
386 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
387 'title' => ts('Batch Exported Date') ,
388 'table_name' => 'civicrm_batch',
390 'bao' => 'CRM_Batch_BAO_Batch',
394 'type' => CRM_Utils_Type
::T_LONGTEXT
,
395 'title' => ts('Batch Data') ,
396 'description' => 'cache entered data',
397 'table_name' => 'civicrm_batch',
399 'bao' => 'CRM_Batch_BAO_Batch',
402 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
404 return Civi
::$statics[__CLASS__
]['fields'];
407 * Return a mapping from field-name to the corresponding key (as used in fields()).
410 * Array(string $name => string $uniqueName).
412 static function &fieldKeys() {
413 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
414 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
416 return Civi
::$statics[__CLASS__
]['fieldKeys'];
419 * Returns the names of this table
423 static function getTableName() {
424 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
427 * Returns if this table needs to be logged
435 * Returns the list of fields that can be imported
437 * @param bool $prefix
441 static function &import($prefix = false) {
442 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'batch', $prefix, array());
446 * Returns the list of fields that can be exported
448 * @param bool $prefix
452 static function &export($prefix = false) {
453 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'batch', $prefix, array());