5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Batch/EntityBatch.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ad54978e70be59ea54b414bbb3131f2f)
13 * Database access object for the EntityBatch entity.
15 class CRM_Batch_DAO_EntityBatch
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_entity_batch';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * physical tablename for entity being joined to file, e.g. civicrm_contact
46 * FK to entity table specified in entity_table column.
62 public function __construct() {
63 $this->__table
= 'civicrm_entity_batch';
64 parent
::__construct();
68 * Returns foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'batch_id', 'civicrm_batch', 'id');
77 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
78 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
80 return Civi
::$statics[__CLASS__
]['links'];
84 * Returns all the column names of this table
88 public static function &fields() {
89 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
90 Civi
::$statics[__CLASS__
]['fields'] = [
93 'type' => CRM_Utils_Type
::T_INT
,
94 'title' => ts('EntityBatch ID'),
95 'description' => ts('primary key'),
97 'where' => 'civicrm_entity_batch.id',
98 'table_name' => 'civicrm_entity_batch',
99 'entity' => 'EntityBatch',
100 'bao' => 'CRM_Batch_BAO_EntityBatch',
104 'name' => 'entity_table',
105 'type' => CRM_Utils_Type
::T_STRING
,
106 'title' => ts('EntityBatch Table'),
107 'description' => ts('physical tablename for entity being joined to file, e.g. civicrm_contact'),
109 'size' => CRM_Utils_Type
::BIG
,
110 'where' => 'civicrm_entity_batch.entity_table',
111 'table_name' => 'civicrm_entity_batch',
112 'entity' => 'EntityBatch',
113 'bao' => 'CRM_Batch_BAO_EntityBatch',
117 'name' => 'entity_id',
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Entity ID'),
120 'description' => ts('FK to entity table specified in entity_table column.'),
122 'where' => 'civicrm_entity_batch.entity_id',
123 'table_name' => 'civicrm_entity_batch',
124 'entity' => 'EntityBatch',
125 'bao' => 'CRM_Batch_BAO_EntityBatch',
129 'name' => 'batch_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Batch ID'),
132 'description' => ts('FK to civicrm_batch'),
134 'where' => 'civicrm_entity_batch.batch_id',
135 'table_name' => 'civicrm_entity_batch',
136 'entity' => 'EntityBatch',
137 'bao' => 'CRM_Batch_BAO_EntityBatch',
139 'FKClassName' => 'CRM_Batch_DAO_Batch',
140 'pseudoconstant' => [
141 'table' => 'civicrm_batch',
143 'labelColumn' => 'title',
147 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
149 return Civi
::$statics[__CLASS__
]['fields'];
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
156 * Array(string $name => string $uniqueName).
158 public static function &fieldKeys() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
160 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
162 return Civi
::$statics[__CLASS__
]['fieldKeys'];
166 * Returns the names of this table
170 public static function getTableName() {
171 return self
::$_tableName;
175 * Returns if this table needs to be logged
179 public function getLog() {
184 * Returns the list of fields that can be imported
186 * @param bool $prefix
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_batch', $prefix, []);
196 * Returns the list of fields that can be exported
198 * @param bool $prefix
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_batch', $prefix, []);
208 * Returns the list of indices
210 * @param bool $localize
214 public static function indices($localize = TRUE) {
217 'name' => 'index_entity',
222 'localizable' => FALSE,
223 'sig' => 'civicrm_entity_batch::0::entity_table::entity_id',
225 'UI_batch_entity' => [
226 'name' => 'UI_batch_entity',
232 'localizable' => FALSE,
234 'sig' => 'civicrm_entity_batch::1::batch_id::entity_id::entity_table',
237 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;