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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Variable name/programmatic handle for this batch.
70 * Description of this batch set.
82 * When was this item created
94 * When was this item created
98 public $modified_date;
100 * FK to Saved Search ID
104 public $saved_search_id;
106 * fk to Batch Status options in civicrm_option_values
112 * fk to Batch Type options in civicrm_option_values
118 * fk to Batch mode options in civicrm_option_values
124 * Total amount for this batch.
130 * Number of items in a batch.
136 * fk to Payment Instrument options in civicrm_option_values
140 public $payment_instrument_id;
145 public $exported_date;
155 * @return civicrm_batch
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',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Batch Name') ,
196 'description' => 'Variable name/programmatic handle for this batch.',
198 'size' => CRM_Utils_Type
::BIG
,
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('Batch Title') ,
207 'description' => 'Friendly Name.',
209 'size' => CRM_Utils_Type
::BIG
,
214 'description' => array(
215 'name' => 'description',
216 'type' => CRM_Utils_Type
::T_TEXT
,
217 'title' => ts('Batch Description') ,
218 'description' => 'Description of this batch set.',
222 'type' => 'TextArea',
225 'created_id' => array(
226 'name' => 'created_id',
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Batch Created By') ,
229 'description' => 'FK to Contact ID',
230 'FKClassName' => 'CRM_Contact_DAO_Contact',
232 'created_date' => array(
233 'name' => 'created_date',
234 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
235 'title' => ts('Batch Created Date') ,
236 'description' => 'When was this item created',
238 'type' => 'Select Date',
241 'modified_id' => array(
242 'name' => 'modified_id',
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Batch Modified By') ,
245 'description' => 'FK to Contact ID',
246 'FKClassName' => 'CRM_Contact_DAO_Contact',
248 'modified_date' => array(
249 'name' => 'modified_date',
250 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
251 'title' => ts('Batch Modified Date') ,
252 'description' => 'When was this item created',
254 'saved_search_id' => array(
255 'name' => 'saved_search_id',
256 'type' => CRM_Utils_Type
::T_INT
,
257 'title' => ts('Batch Smart Group') ,
258 'description' => 'FK to Saved Search ID',
259 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
261 'type' => 'EntityRef',
264 'status_id' => array(
265 'name' => 'status_id',
266 'type' => CRM_Utils_Type
::T_INT
,
267 'title' => ts('Batch Status') ,
268 'description' => 'fk to Batch Status options in civicrm_option_values',
273 'pseudoconstant' => array(
274 'optionGroupName' => 'batch_status',
275 'optionEditPath' => 'civicrm/admin/options/batch_status',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Batch Type') ,
282 'description' => 'fk to Batch Type options in civicrm_option_values',
286 'pseudoconstant' => array(
287 'optionGroupName' => 'batch_type',
288 'optionEditPath' => 'civicrm/admin/options/batch_type',
293 'type' => CRM_Utils_Type
::T_INT
,
294 'title' => ts('Batch Mode') ,
295 'description' => 'fk to Batch mode options in civicrm_option_values',
299 'pseudoconstant' => array(
300 'optionGroupName' => 'batch_mode',
301 'optionEditPath' => 'civicrm/admin/options/batch_mode',
306 'type' => CRM_Utils_Type
::T_MONEY
,
307 'title' => ts('Batch Total') ,
308 'description' => 'Total amount for this batch.',
309 'precision' => array(
317 'item_count' => array(
318 'name' => 'item_count',
319 'type' => CRM_Utils_Type
::T_INT
,
320 'title' => ts('Batch Number of Items') ,
321 'description' => 'Number of items in a batch.',
326 'payment_instrument_id' => array(
327 'name' => 'payment_instrument_id',
328 'type' => CRM_Utils_Type
::T_INT
,
329 'title' => ts('Batch Payment Method') ,
330 'description' => 'fk to Payment Instrument options in civicrm_option_values',
334 'pseudoconstant' => array(
335 'optionGroupName' => 'payment_instrument',
336 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
339 'exported_date' => array(
340 'name' => 'exported_date',
341 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
342 'title' => ts('Batch Exported Date') ,
346 'type' => CRM_Utils_Type
::T_LONGTEXT
,
347 'title' => ts('Batch Data') ,
348 'description' => 'cache entered data',
351 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
353 return Civi
::$statics[__CLASS__
]['fields'];
356 * Return a mapping from field-name to the corresponding key (as used in fields()).
359 * Array(string $name => string $uniqueName).
361 static function &fieldKeys() {
362 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
363 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
365 return Civi
::$statics[__CLASS__
]['fieldKeys'];
368 * Returns the names of this table
372 static function getTableName() {
373 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
376 * Returns if this table needs to be logged
384 * Returns the list of fields that can be imported
386 * @param bool $prefix
390 static function &import($prefix = false) {
391 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'batch', $prefix, array());
395 * Returns the list of fields that can be exported
397 * @param bool $prefix
401 static function &export($prefix = false) {
402 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'batch', $prefix, array());