3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Batch/Batch.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c2030f71901c97e7914636c6c817beb9)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Batch_DAO_Batch
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_batch';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Variable name/programmatic handle for this batch.
102 * Description of this batch set.
114 * When was this item created
118 public $created_date;
126 * When was this item created
130 public $modified_date;
132 * FK to Saved Search ID
136 public $saved_search_id;
138 * fk to Batch Status options in civicrm_option_values
144 * fk to Batch Type options in civicrm_option_values
150 * fk to Batch mode options in civicrm_option_values
156 * Total amount for this batch.
162 * Number of items in a batch.
168 * fk to Payment Instrument options in civicrm_option_values
172 public $payment_instrument_id;
177 public $exported_date;
187 * @return civicrm_batch
189 function __construct() {
190 $this->__table
= 'civicrm_batch';
191 parent
::__construct();
194 * Returns foreign keys and entity references
197 * [CRM_Core_Reference_Interface]
199 static function getReferenceColumns() {
200 if (!self
::$_links) {
201 self
::$_links = static ::createReferenceColumns(__CLASS__
);
202 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
203 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
204 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
206 return self
::$_links;
209 * Returns all the column names of this table
213 static function &fields() {
214 if (!(self
::$_fields)) {
215 self
::$_fields = array(
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Batch ID') ,
220 'description' => 'Unique Address ID',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Batch Name') ,
227 'description' => 'Variable name/programmatic handle for this batch.',
229 'size' => CRM_Utils_Type
::BIG
,
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Batch Title') ,
238 'description' => 'Friendly Name.',
240 'size' => CRM_Utils_Type
::BIG
,
245 'description' => array(
246 'name' => 'description',
247 'type' => CRM_Utils_Type
::T_TEXT
,
248 'title' => ts('Batch Description') ,
249 'description' => 'Description of this batch set.',
253 'type' => 'TextArea',
256 'created_id' => array(
257 'name' => 'created_id',
258 'type' => CRM_Utils_Type
::T_INT
,
259 'title' => ts('Batch Created By') ,
260 'description' => 'FK to Contact ID',
261 'FKClassName' => 'CRM_Contact_DAO_Contact',
263 'created_date' => array(
264 'name' => 'created_date',
265 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
266 'title' => ts('Batch Created Date') ,
267 'description' => 'When was this item created',
269 'type' => 'Select Date',
272 'modified_id' => array(
273 'name' => 'modified_id',
274 'type' => CRM_Utils_Type
::T_INT
,
275 'title' => ts('Batch Modified By') ,
276 'description' => 'FK to Contact ID',
277 'FKClassName' => 'CRM_Contact_DAO_Contact',
279 'modified_date' => array(
280 'name' => 'modified_date',
281 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
282 'title' => ts('Batch Modified Date') ,
283 'description' => 'When was this item created',
285 'saved_search_id' => array(
286 'name' => 'saved_search_id',
287 'type' => CRM_Utils_Type
::T_INT
,
288 'title' => ts('Batch Smart Group') ,
289 'description' => 'FK to Saved Search ID',
290 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
292 'type' => 'EntityRef',
295 'status_id' => array(
296 'name' => 'status_id',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Batch Status') ,
299 'description' => 'fk to Batch Status options in civicrm_option_values',
304 'pseudoconstant' => array(
305 'optionGroupName' => 'batch_status',
306 'optionEditPath' => 'civicrm/admin/options/batch_status',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Batch Type') ,
313 'description' => 'fk to Batch Type options in civicrm_option_values',
317 'pseudoconstant' => array(
318 'optionGroupName' => 'batch_type',
319 'optionEditPath' => 'civicrm/admin/options/batch_type',
324 'type' => CRM_Utils_Type
::T_INT
,
325 'title' => ts('Batch Mode') ,
326 'description' => 'fk to Batch mode options in civicrm_option_values',
330 'pseudoconstant' => array(
331 'optionGroupName' => 'batch_mode',
332 'optionEditPath' => 'civicrm/admin/options/batch_mode',
337 'type' => CRM_Utils_Type
::T_MONEY
,
338 'title' => ts('Batch Total') ,
339 'description' => 'Total amount for this batch.',
340 'precision' => array(
348 'item_count' => array(
349 'name' => 'item_count',
350 'type' => CRM_Utils_Type
::T_INT
,
351 'title' => ts('Batch Number of Items') ,
352 'description' => 'Number of items in a batch.',
357 'payment_instrument_id' => array(
358 'name' => 'payment_instrument_id',
359 'type' => CRM_Utils_Type
::T_INT
,
360 'title' => ts('Batch Payment Method') ,
361 'description' => 'fk to Payment Instrument options in civicrm_option_values',
365 'pseudoconstant' => array(
366 'optionGroupName' => 'payment_instrument',
367 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
370 'exported_date' => array(
371 'name' => 'exported_date',
372 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
373 'title' => ts('Batch Exported Date') ,
377 'type' => CRM_Utils_Type
::T_LONGTEXT
,
378 'title' => ts('Batch Data') ,
379 'description' => 'cache entered data',
383 return self
::$_fields;
386 * Returns an array containing, for each field, the arary key used for that
387 * field in self::$_fields.
391 static function &fieldKeys() {
392 if (!(self
::$_fieldKeys)) {
393 self
::$_fieldKeys = array(
397 'description' => 'description',
398 'created_id' => 'created_id',
399 'created_date' => 'created_date',
400 'modified_id' => 'modified_id',
401 'modified_date' => 'modified_date',
402 'saved_search_id' => 'saved_search_id',
403 'status_id' => 'status_id',
404 'type_id' => 'type_id',
405 'mode_id' => 'mode_id',
407 'item_count' => 'item_count',
408 'payment_instrument_id' => 'payment_instrument_id',
409 'exported_date' => 'exported_date',
413 return self
::$_fieldKeys;
416 * Returns the names of this table
420 static function getTableName() {
421 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
424 * Returns if this table needs to be logged
432 * Returns the list of fields that can be imported
434 * @param bool $prefix
438 static function &import($prefix = false) {
439 if (!(self
::$_import)) {
440 self
::$_import = array();
441 $fields = self
::fields();
442 foreach($fields as $name => $field) {
443 if (CRM_Utils_Array
::value('import', $field)) {
445 self
::$_import['batch'] = & $fields[$name];
447 self
::$_import[$name] = & $fields[$name];
452 return self
::$_import;
455 * Returns the list of fields that can be exported
457 * @param bool $prefix
461 static function &export($prefix = false) {
462 if (!(self
::$_export)) {
463 self
::$_export = array();
464 $fields = self
::fields();
465 foreach($fields as $name => $field) {
466 if (CRM_Utils_Array
::value('export', $field)) {
468 self
::$_export['batch'] = & $fields[$name];
470 self
::$_export[$name] = & $fields[$name];
475 return self
::$_export;