+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
-| Copyright CiviCRM LLC (c) 2004-2016 |
+| Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*
* Generated from xml/schema/CRM/Batch/Batch.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:81081e8ad03b0097ba7949b4425b1ca8)
+ * (GenCodeChecksum:d02020e92b997906c5591971b4c4b988)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+/**
+ * CRM_Batch_DAO_Batch constructor.
+ */
class CRM_Batch_DAO_Batch extends CRM_Core_DAO {
/**
- * static instance to hold the table name
+ * Static instance to hold the table name.
*
* @var string
*/
static $_tableName = 'civicrm_batch';
/**
- * static instance to hold the field values
- *
- * @var array
- */
- static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
- /**
- * static instance to hold the FK relationships
- *
- * @var string
- */
- static $_links = null;
- /**
- * static value to see if we should log any modifications to
- * this table in the civicrm_log table
+ * Should CiviCRM log any modifications to this table in the civicrm_log table.
*
* @var boolean
*/
*/
public $data;
/**
- * class constructor
- *
- * @return civicrm_batch
+ * Class constructor.
*/
function __construct() {
$this->__table = 'civicrm_batch';
parent::__construct();
}
/**
- * Returns foreign keys and entity references
+ * Returns foreign keys and entity references.
*
* @return array
* [CRM_Core_Reference_Interface]
*/
static function getReferenceColumns() {
- if (!self::$_links) {
- self::$_links = static ::createReferenceColumns(__CLASS__);
- self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
- self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
- self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
+ if (!isset(Civi::$statics[__CLASS__]['links'])) {
+ Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
+ Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
+ Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'modified_id', 'civicrm_contact', 'id');
+ Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'saved_search_id', 'civicrm_saved_search', 'id');
+ CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
}
- return self::$_links;
+ return Civi::$statics[__CLASS__]['links'];
}
/**
* Returns all the column names of this table
* @return array
*/
static function &fields() {
- if (!(self::$_fields)) {
- self::$_fields = array(
+ if (!isset(Civi::$statics[__CLASS__]['fields'])) {
+ Civi::$statics[__CLASS__]['fields'] = array(
'id' => array(
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch ID') ,
'description' => 'Unique Address ID',
'required' => true,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
) ,
'name' => array(
'name' => 'name',
'description' => 'Variable name/programmatic handle for this batch.',
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Text',
) ,
'description' => 'Friendly Name.',
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Text',
) ,
'description' => 'Description of this batch set.',
'rows' => 4,
'cols' => 80,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'TextArea',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Created By') ,
'description' => 'FK to Contact ID',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'FKClassName' => 'CRM_Contact_DAO_Contact',
) ,
'created_date' => array(
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => ts('Batch Created Date') ,
'description' => 'When was this item created',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Select Date',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Modified By') ,
'description' => 'FK to Contact ID',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'FKClassName' => 'CRM_Contact_DAO_Contact',
) ,
'modified_date' => array(
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => ts('Batch Modified Date') ,
'description' => 'When was this item created',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
) ,
'saved_search_id' => array(
'name' => 'saved_search_id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Smart Group') ,
'description' => 'FK to Saved Search ID',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
'html' => array(
'type' => 'EntityRef',
'title' => ts('Batch Status') ,
'description' => 'fk to Batch Status options in civicrm_option_values',
'required' => true,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Select',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Type') ,
'description' => 'fk to Batch Type options in civicrm_option_values',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Select',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Mode') ,
'description' => 'fk to Batch mode options in civicrm_option_values',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Select',
) ,
20,
2
) ,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Text',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Number of Items') ,
'description' => 'Number of items in a batch.',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Text',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Batch Payment Method') ,
'description' => 'fk to Payment Instrument options in civicrm_option_values',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
'html' => array(
'type' => 'Select',
) ,
'name' => 'exported_date',
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => ts('Batch Exported Date') ,
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
) ,
'data' => array(
'name' => 'data',
'type' => CRM_Utils_Type::T_LONGTEXT,
'title' => ts('Batch Data') ,
'description' => 'cache entered data',
+ 'table_name' => 'civicrm_batch',
+ 'entity' => 'Batch',
+ 'bao' => 'CRM_Batch_BAO_Batch',
) ,
);
+ CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
- return self::$_fields;
+ return Civi::$statics[__CLASS__]['fields'];
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'name' => 'name',
- 'title' => 'title',
- 'description' => 'description',
- 'created_id' => 'created_id',
- 'created_date' => 'created_date',
- 'modified_id' => 'modified_id',
- 'modified_date' => 'modified_date',
- 'saved_search_id' => 'saved_search_id',
- 'status_id' => 'status_id',
- 'type_id' => 'type_id',
- 'mode_id' => 'mode_id',
- 'total' => 'total',
- 'item_count' => 'item_count',
- 'payment_instrument_id' => 'payment_instrument_id',
- 'exported_date' => 'exported_date',
- 'data' => 'data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table