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 FK relationships
55 static $_links = null;
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
70 * Variable name/programmatic handle for this batch.
82 * Description of this batch set.
94 * When was this item created
106 * When was this item created
110 public $modified_date;
112 * FK to Saved Search ID
116 public $saved_search_id;
118 * fk to Batch Status options in civicrm_option_values
124 * fk to Batch Type options in civicrm_option_values
130 * fk to Batch mode options in civicrm_option_values
136 * Total amount for this batch.
142 * Number of items in a batch.
148 * fk to Payment Instrument options in civicrm_option_values
152 public $payment_instrument_id;
157 public $exported_date;
167 * @return civicrm_batch
169 function __construct() {
170 $this->__table
= 'civicrm_batch';
171 parent
::__construct();
174 * Returns foreign keys and entity references
177 * [CRM_Core_Reference_Interface]
179 static function getReferenceColumns() {
180 if (!self
::$_links) {
181 self
::$_links = static ::createReferenceColumns(__CLASS__
);
182 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
183 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'modified_id', 'civicrm_contact', 'id');
184 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
186 return self
::$_links;
189 * Returns all the column names of this table
193 static function &fields() {
194 if (!(self
::$_fields)) {
195 self
::$_fields = array(
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Batch ID') ,
200 'description' => 'Unique Address ID',
205 'type' => CRM_Utils_Type
::T_STRING
,
206 'title' => ts('Batch Name') ,
207 'description' => 'Variable name/programmatic handle for this batch.',
209 'size' => CRM_Utils_Type
::BIG
,
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Batch Title') ,
218 'description' => 'Friendly Name.',
220 'size' => CRM_Utils_Type
::BIG
,
225 'description' => array(
226 'name' => 'description',
227 'type' => CRM_Utils_Type
::T_TEXT
,
228 'title' => ts('Batch Description') ,
229 'description' => 'Description of this batch set.',
233 'type' => 'TextArea',
236 'created_id' => array(
237 'name' => 'created_id',
238 'type' => CRM_Utils_Type
::T_INT
,
239 'title' => ts('Batch Created By') ,
240 'description' => 'FK to Contact ID',
241 'FKClassName' => 'CRM_Contact_DAO_Contact',
243 'created_date' => array(
244 'name' => 'created_date',
245 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
246 'title' => ts('Batch Created Date') ,
247 'description' => 'When was this item created',
249 'type' => 'Select Date',
252 'modified_id' => array(
253 'name' => 'modified_id',
254 'type' => CRM_Utils_Type
::T_INT
,
255 'title' => ts('Batch Modified By') ,
256 'description' => 'FK to Contact ID',
257 'FKClassName' => 'CRM_Contact_DAO_Contact',
259 'modified_date' => array(
260 'name' => 'modified_date',
261 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
262 'title' => ts('Batch Modified Date') ,
263 'description' => 'When was this item created',
265 'saved_search_id' => array(
266 'name' => 'saved_search_id',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('Batch Smart Group') ,
269 'description' => 'FK to Saved Search ID',
270 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
272 'type' => 'EntityRef',
275 'status_id' => array(
276 'name' => 'status_id',
277 'type' => CRM_Utils_Type
::T_INT
,
278 'title' => ts('Batch Status') ,
279 'description' => 'fk to Batch Status options in civicrm_option_values',
284 'pseudoconstant' => array(
285 'optionGroupName' => 'batch_status',
286 'optionEditPath' => 'civicrm/admin/options/batch_status',
291 'type' => CRM_Utils_Type
::T_INT
,
292 'title' => ts('Batch Type') ,
293 'description' => 'fk to Batch Type options in civicrm_option_values',
297 'pseudoconstant' => array(
298 'optionGroupName' => 'batch_type',
299 'optionEditPath' => 'civicrm/admin/options/batch_type',
304 'type' => CRM_Utils_Type
::T_INT
,
305 'title' => ts('Batch Mode') ,
306 'description' => 'fk to Batch mode options in civicrm_option_values',
310 'pseudoconstant' => array(
311 'optionGroupName' => 'batch_mode',
312 'optionEditPath' => 'civicrm/admin/options/batch_mode',
317 'type' => CRM_Utils_Type
::T_MONEY
,
318 'title' => ts('Batch Total') ,
319 'description' => 'Total amount for this batch.',
320 'precision' => array(
328 'item_count' => array(
329 'name' => 'item_count',
330 'type' => CRM_Utils_Type
::T_INT
,
331 'title' => ts('Batch Number of Items') ,
332 'description' => 'Number of items in a batch.',
337 'payment_instrument_id' => array(
338 'name' => 'payment_instrument_id',
339 'type' => CRM_Utils_Type
::T_INT
,
340 'title' => ts('Batch Payment Method') ,
341 'description' => 'fk to Payment Instrument options in civicrm_option_values',
345 'pseudoconstant' => array(
346 'optionGroupName' => 'payment_instrument',
347 'optionEditPath' => 'civicrm/admin/options/payment_instrument',
350 'exported_date' => array(
351 'name' => 'exported_date',
352 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
353 'title' => ts('Batch Exported Date') ,
357 'type' => CRM_Utils_Type
::T_LONGTEXT
,
358 'title' => ts('Batch Data') ,
359 'description' => 'cache entered data',
363 return self
::$_fields;
366 * Return a mapping from field-name to the corresponding key (as used in fields()).
369 * Array(string $name => string $uniqueName).
371 static function &fieldKeys() {
372 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
373 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
375 return Civi
::$statics[__CLASS__
]['fieldKeys'];
378 * Returns the names of this table
382 static function getTableName() {
383 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
386 * Returns if this table needs to be logged
394 * Returns the list of fields that can be imported
396 * @param bool $prefix
400 static function &import($prefix = false) {
401 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'batch', $prefix, array());
405 * Returns the list of fields that can be exported
407 * @param bool $prefix
411 static function &export($prefix = false) {
412 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'batch', $prefix, array());