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 static $_tableName = 'civicrm_entity_batch';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_entity_batch',
98 'entity' => 'EntityBatch',
99 'bao' => 'CRM_Batch_BAO_EntityBatch',
103 'name' => 'entity_table',
104 'type' => CRM_Utils_Type
::T_STRING
,
105 'title' => ts('EntityBatch Table'),
106 'description' => ts('physical tablename for entity being joined to file, e.g. civicrm_contact'),
108 'size' => CRM_Utils_Type
::BIG
,
109 'table_name' => 'civicrm_entity_batch',
110 'entity' => 'EntityBatch',
111 'bao' => 'CRM_Batch_BAO_EntityBatch',
115 'name' => 'entity_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Entity ID'),
118 'description' => ts('FK to entity table specified in entity_table column.'),
120 'table_name' => 'civicrm_entity_batch',
121 'entity' => 'EntityBatch',
122 'bao' => 'CRM_Batch_BAO_EntityBatch',
126 'name' => 'batch_id',
127 'type' => CRM_Utils_Type
::T_INT
,
128 'title' => ts('Batch ID'),
129 'description' => ts('FK to civicrm_batch'),
131 'table_name' => 'civicrm_entity_batch',
132 'entity' => 'EntityBatch',
133 'bao' => 'CRM_Batch_BAO_EntityBatch',
135 'FKClassName' => 'CRM_Batch_DAO_Batch',
136 'pseudoconstant' => [
137 'table' => 'civicrm_batch',
139 'labelColumn' => 'title',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'entity_batch', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'entity_batch', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
213 'name' => 'index_entity',
218 'localizable' => FALSE,
219 'sig' => 'civicrm_entity_batch::0::entity_table::entity_id',
221 'UI_batch_entity' => [
222 'name' => 'UI_batch_entity',
228 'localizable' => FALSE,
230 'sig' => 'civicrm_entity_batch::1::batch_id::entity_id::entity_table',
233 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;