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:81081e8ad03b0097ba7949b4425b1ca8)
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 value to see if we should log any modifications to
64 * this table in the civicrm_log table
76 * Variable name/programmatic handle for this batch.
88 * Description of this batch set.
100 * When was this item created
104 public $created_date;
112 * When was this item created
116 public $modified_date;
118 * FK to Saved Search ID
122 public $saved_search_id;
124 * fk to Batch Status options in civicrm_option_values
130 * fk to Batch Type options in civicrm_option_values
136 * fk to Batch mode options in civicrm_option_values
142 * Total amount for this batch.
148 * Number of items in a batch.
154 * fk to Payment Instrument options in civicrm_option_values
158 public $payment_instrument_id;
163 public $exported_date;
173 * @return civicrm_batch
175 function __construct() {
176 $this->__table
= 'civicrm_batch';
177 parent
::__construct();
180 * Returns foreign keys and entity references
183 * [CRM_Core_Reference_Interface]
185 static function getReferenceColumns() {
186 if (!self
::$_links) {
187 self
::$_links = static ::createReferenceColumns(__CLASS__
);
188 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
189 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
190 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
192 return self
::$_links;
195 * Returns all the column names of this table
199 static function &fields() {
200 if (!(self
::$_fields)) {
201 self
::$_fields = array(
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Batch ID') ,
206 'description' => 'Unique Address ID',
211 'type' => CRM_Utils_Type
::T_STRING
,
212 'title' => ts('Batch Name') ,
213 'description' => 'Variable name/programmatic handle for this batch.',
215 'size' => CRM_Utils_Type
::BIG
,
222 'type' => CRM_Utils_Type
::T_STRING
,
223 'title' => ts('Batch Title') ,
224 'description' => 'Friendly Name.',
226 'size' => CRM_Utils_Type
::BIG
,
231 'description' => array(
232 'name' => 'description',
233 'type' => CRM_Utils_Type
::T_TEXT
,
234 'title' => ts('Batch Description') ,
235 'description' => 'Description of this batch set.',
239 'type' => 'TextArea',
242 'created_id' => array(
243 'name' => 'created_id',
244 'type' => CRM_Utils_Type
::T_INT
,
245 'title' => ts('Batch Created By') ,
246 'description' => 'FK to Contact ID',
247 'FKClassName' => 'CRM_Contact_DAO_Contact',
249 'created_date' => array(
250 'name' => 'created_date',
251 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
252 'title' => ts('Batch Created Date') ,
253 'description' => 'When was this item created',
255 'type' => 'Select Date',
258 'modified_id' => array(
259 'name' => 'modified_id',
260 'type' => CRM_Utils_Type
::T_INT
,
261 'title' => ts('Batch Modified By') ,
262 'description' => 'FK to Contact ID',
263 'FKClassName' => 'CRM_Contact_DAO_Contact',
265 'modified_date' => array(
266 'name' => 'modified_date',
267 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
268 'title' => ts('Batch Modified Date') ,
269 'description' => 'When was this item created',
271 'saved_search_id' => array(
272 'name' => 'saved_search_id',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Batch Smart Group') ,
275 'description' => 'FK to Saved Search ID',
276 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
278 'type' => 'EntityRef',
281 'status_id' => array(
282 'name' => 'status_id',
283 'type' => CRM_Utils_Type
::T_INT
,
284 'title' => ts('Batch Status') ,
285 'description' => 'fk to Batch Status options in civicrm_option_values',
290 'pseudoconstant' => array(
291 'optionGroupName' => 'batch_status',
292 'optionEditPath' => 'civicrm/admin/options/batch_status',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Batch Type') ,
299 'description' => 'fk to Batch Type options in civicrm_option_values',
303 'pseudoconstant' => array(
304 'optionGroupName' => 'batch_type',
305 'optionEditPath' => 'civicrm/admin/options/batch_type',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Batch Mode') ,
312 'description' => 'fk to Batch mode options in civicrm_option_values',
316 'pseudoconstant' => array(
317 'optionGroupName' => 'batch_mode',
318 'optionEditPath' => 'civicrm/admin/options/batch_mode',
323 'type' => CRM_Utils_Type
::T_MONEY
,
324 'title' => ts('Batch Total') ,
325 'description' => 'Total amount for this batch.',
326 'precision' => array(
334 'item_count' => array(
335 'name' => 'item_count',
336 'type' => CRM_Utils_Type
::T_INT
,
337 'title' => ts('Batch Number of Items') ,
338 'description' => 'Number of items in a batch.',
343 'payment_instrument_id' => array(
344 'name' => 'payment_instrument_id',
345 'type' => CRM_Utils_Type
::T_INT
,
346 'title' => ts('Batch Payment Method') ,
347 'description' => 'fk to Payment Instrument options in civicrm_option_values',
351 'pseudoconstant' => array(
352 'optionGroupName' => 'payment_instrument',
353 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
356 'exported_date' => array(
357 'name' => 'exported_date',
358 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
359 'title' => ts('Batch Exported Date') ,
363 'type' => CRM_Utils_Type
::T_LONGTEXT
,
364 'title' => ts('Batch Data') ,
365 'description' => 'cache entered data',
369 return self
::$_fields;
372 * Returns an array containing, for each field, the arary key used for that
373 * field in self::$_fields.
377 static function &fieldKeys() {
378 if (!(self
::$_fieldKeys)) {
379 self
::$_fieldKeys = array(
383 'description' => 'description',
384 'created_id' => 'created_id',
385 'created_date' => 'created_date',
386 'modified_id' => 'modified_id',
387 'modified_date' => 'modified_date',
388 'saved_search_id' => 'saved_search_id',
389 'status_id' => 'status_id',
390 'type_id' => 'type_id',
391 'mode_id' => 'mode_id',
393 'item_count' => 'item_count',
394 'payment_instrument_id' => 'payment_instrument_id',
395 'exported_date' => 'exported_date',
399 return self
::$_fieldKeys;
402 * Returns the names of this table
406 static function getTableName() {
407 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
410 * Returns if this table needs to be logged
418 * Returns the list of fields that can be imported
420 * @param bool $prefix
424 static function &import($prefix = false) {
425 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'batch', $prefix, array());
429 * Returns the list of fields that can be exported
431 * @param bool $prefix
435 static function &export($prefix = false) {
436 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'batch', $prefix, array());