5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Batch/EntityBatch.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6b6bd1337d9011c2a262de0e62c1e8e1)
13 * Database access object for the EntityBatch entity.
15 class CRM_Batch_DAO_EntityBatch
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.3';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_entity_batch';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * physical tablename for entity being joined to file, e.g. civicrm_contact
48 * FK to entity table specified in entity_table column.
64 public function __construct() {
65 $this->__table
= 'civicrm_entity_batch';
66 parent
::__construct();
70 * Returns localized title of this entity.
72 public static function getEntityTitle() {
73 return ts('Entity Batches');
77 * Returns foreign keys and entity references.
80 * [CRM_Core_Reference_Interface]
82 public static function getReferenceColumns() {
83 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
84 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
85 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'batch_id', 'civicrm_batch', 'id');
86 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
87 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
89 return Civi
::$statics[__CLASS__
]['links'];
93 * Returns all the column names of this table
97 public static function &fields() {
98 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
99 Civi
::$statics[__CLASS__
]['fields'] = [
102 'type' => CRM_Utils_Type
::T_INT
,
103 'title' => ts('EntityBatch ID'),
104 'description' => ts('primary key'),
106 'where' => 'civicrm_entity_batch.id',
107 'table_name' => 'civicrm_entity_batch',
108 'entity' => 'EntityBatch',
109 'bao' => 'CRM_Batch_BAO_EntityBatch',
114 'name' => 'entity_table',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('EntityBatch Table'),
117 'description' => ts('physical tablename for entity being joined to file, e.g. civicrm_contact'),
119 'size' => CRM_Utils_Type
::BIG
,
120 'where' => 'civicrm_entity_batch.entity_table',
121 'table_name' => 'civicrm_entity_batch',
122 'entity' => 'EntityBatch',
123 'bao' => 'CRM_Batch_BAO_EntityBatch',
128 'name' => 'entity_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Entity ID'),
131 'description' => ts('FK to entity table specified in entity_table column.'),
133 'where' => 'civicrm_entity_batch.entity_id',
134 'table_name' => 'civicrm_entity_batch',
135 'entity' => 'EntityBatch',
136 'bao' => 'CRM_Batch_BAO_EntityBatch',
141 'name' => 'batch_id',
142 'type' => CRM_Utils_Type
::T_INT
,
143 'title' => ts('Batch ID'),
144 'description' => ts('FK to civicrm_batch'),
146 'where' => 'civicrm_entity_batch.batch_id',
147 'table_name' => 'civicrm_entity_batch',
148 'entity' => 'EntityBatch',
149 'bao' => 'CRM_Batch_BAO_EntityBatch',
151 'FKClassName' => 'CRM_Batch_DAO_Batch',
152 'pseudoconstant' => [
153 'table' => 'civicrm_batch',
155 'labelColumn' => 'title',
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
162 return Civi
::$statics[__CLASS__
]['fields'];
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
169 * Array(string $name => string $uniqueName).
171 public static function &fieldKeys() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
173 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
175 return Civi
::$statics[__CLASS__
]['fieldKeys'];
179 * Returns the names of this table
183 public static function getTableName() {
184 return self
::$_tableName;
188 * Returns if this table needs to be logged
192 public function getLog() {
197 * Returns the list of fields that can be imported
199 * @param bool $prefix
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_batch', $prefix, []);
209 * Returns the list of fields that can be exported
211 * @param bool $prefix
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_batch', $prefix, []);
221 * Returns the list of indices
223 * @param bool $localize
227 public static function indices($localize = TRUE) {
230 'name' => 'index_entity',
235 'localizable' => FALSE,
236 'sig' => 'civicrm_entity_batch::0::entity_table::entity_id',
238 'UI_batch_entity' => [
239 'name' => 'UI_batch_entity',
245 'localizable' => FALSE,
247 'sig' => 'civicrm_entity_batch::1::batch_id::entity_id::entity_table',
250 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;