5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/RecurringEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d8ff65b4009b67e8619f6f904c1b501d)
13 * Database access object for the RecurringEntity entity.
15 class CRM_Core_DAO_RecurringEntity
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.6';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_recurring_entity';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * Recurring Entity Parent ID
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
50 * Recurring Entity Child ID
52 * @var int|string|null
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
59 * Physical tablename for entity, e.g. civicrm_event
62 * (SQL type: varchar(64))
63 * Note that values will be retrieved from the database as a string.
68 * 1-this entity, 2-this and the following entities, 3-all the entities
72 * Note that values will be retrieved from the database as a string.
79 public function __construct() {
80 $this->__table
= 'civicrm_recurring_entity';
81 parent
::__construct();
85 * Returns localized title of this entity.
88 * Whether to return the plural version of the title.
90 public static function getEntityTitle($plural = FALSE) {
91 return $plural ?
ts('Recurring Entities') : ts('Recurring Entity');
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
107 'where' => 'civicrm_recurring_entity.id',
108 'table_name' => 'civicrm_recurring_entity',
109 'entity' => 'RecurringEntity',
110 'bao' => 'CRM_Core_BAO_RecurringEntity',
119 'name' => 'parent_id',
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Parent ID'),
122 'description' => ts('Recurring Entity Parent ID'),
124 'where' => 'civicrm_recurring_entity.parent_id',
125 'table_name' => 'civicrm_recurring_entity',
126 'entity' => 'RecurringEntity',
127 'bao' => 'CRM_Core_BAO_RecurringEntity',
132 'name' => 'entity_id',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Entity ID'),
135 'description' => ts('Recurring Entity Child ID'),
136 'where' => 'civicrm_recurring_entity.entity_id',
137 'table_name' => 'civicrm_recurring_entity',
138 'entity' => 'RecurringEntity',
139 'bao' => 'CRM_Core_BAO_RecurringEntity',
144 'name' => 'entity_table',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Entity Table'),
147 'description' => ts('Physical tablename for entity, e.g. civicrm_event'),
150 'size' => CRM_Utils_Type
::BIG
,
151 'where' => 'civicrm_recurring_entity.entity_table',
152 'table_name' => 'civicrm_recurring_entity',
153 'entity' => 'RecurringEntity',
154 'bao' => 'CRM_Core_BAO_RecurringEntity',
160 'type' => CRM_Utils_Type
::T_BOOLEAN
,
161 'title' => ts('Cascade Type'),
162 'description' => ts('1-this entity, 2-this and the following entities, 3-all the entities'),
164 'where' => 'civicrm_recurring_entity.mode',
166 'table_name' => 'civicrm_recurring_entity',
167 'entity' => 'RecurringEntity',
168 'bao' => 'CRM_Core_BAO_RecurringEntity',
173 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
175 return Civi
::$statics[__CLASS__
]['fields'];
179 * Return a mapping from field-name to the corresponding key (as used in fields()).
182 * Array(string $name => string $uniqueName).
184 public static function &fieldKeys() {
185 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
186 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
188 return Civi
::$statics[__CLASS__
]['fieldKeys'];
192 * Returns the names of this table
196 public static function getTableName() {
197 return self
::$_tableName;
201 * Returns if this table needs to be logged
205 public function getLog() {
210 * Returns the list of fields that can be imported
212 * @param bool $prefix
216 public static function &import($prefix = FALSE) {
217 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'recurring_entity', $prefix, []);
222 * Returns the list of fields that can be exported
224 * @param bool $prefix
228 public static function &export($prefix = FALSE) {
229 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'recurring_entity', $prefix, []);
234 * Returns the list of indices
236 * @param bool $localize
240 public static function indices($localize = TRUE) {
242 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;