API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Core / DAO / RecurringEntity.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/RecurringEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
a9d0587b 9 * (GenCodeChecksum:4d0ee948935c36ddf9c0a04ed30ec44f)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the RecurringEntity entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_recurring_entity';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = TRUE;
c3fc2621 30
e501603b 31 /**
e6ca0a57 32 * @var int
e501603b
TO
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * Recurring Entity Parent ID
38 *
e6ca0a57 39 * @var int
e501603b
TO
40 */
41 public $parent_id;
c3fc2621 42
e501603b
TO
43 /**
44 * Recurring Entity Child ID
45 *
e6ca0a57 46 * @var int
e501603b
TO
47 */
48 public $entity_id;
c3fc2621 49
e501603b
TO
50 /**
51 * Physical tablename for entity, e.g. civicrm_event
52 *
53 * @var string
54 */
55 public $entity_table;
c3fc2621 56
e501603b
TO
57 /**
58 * 1-this entity, 2-this and the following entities, 3-all the entities
59 *
e6ca0a57 60 * @var bool
e501603b
TO
61 */
62 public $mode;
c3fc2621 63
e501603b 64 /**
f41f0342 65 * Class constructor.
e501603b 66 */
c3fc2621 67 public function __construct() {
e501603b
TO
68 $this->__table = 'civicrm_recurring_entity';
69 parent::__construct();
70 }
c3fc2621 71
449c4e6b
CW
72 /**
73 * Returns localized title of this entity.
74 */
75 public static function getEntityTitle() {
76 return ts('Recurring Entities');
77 }
78
e501603b
TO
79 /**
80 * Returns all the column names of this table
81 *
82 * @return array
83 */
c3fc2621 84 public static function &fields() {
346aaaba 85 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
86 Civi::$statics[__CLASS__]['fields'] = [
87 'id' => [
e501603b
TO
88 'name' => 'id',
89 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
90 'title' => ts('ID'),
91 'required' => TRUE,
a36434b9 92 'where' => 'civicrm_recurring_entity.id',
522a26c9 93 'table_name' => 'civicrm_recurring_entity',
94 'entity' => 'RecurringEntity',
95 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 96 'localizable' => 0,
a9d0587b 97 'add' => '4.6',
c3fc2621
CW
98 ],
99 'parent_id' => [
e501603b
TO
100 'name' => 'parent_id',
101 'type' => CRM_Utils_Type::T_INT,
c3fc2621 102 'title' => ts('Parent ID'),
215b423e 103 'description' => ts('Recurring Entity Parent ID'),
c3fc2621 104 'required' => TRUE,
a36434b9 105 'where' => 'civicrm_recurring_entity.parent_id',
522a26c9 106 'table_name' => 'civicrm_recurring_entity',
107 'entity' => 'RecurringEntity',
108 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 109 'localizable' => 0,
a9d0587b 110 'add' => '4.6',
c3fc2621
CW
111 ],
112 'entity_id' => [
e501603b
TO
113 'name' => 'entity_id',
114 'type' => CRM_Utils_Type::T_INT,
c3fc2621 115 'title' => ts('Entity ID'),
215b423e 116 'description' => ts('Recurring Entity Child ID'),
a36434b9 117 'where' => 'civicrm_recurring_entity.entity_id',
522a26c9 118 'table_name' => 'civicrm_recurring_entity',
119 'entity' => 'RecurringEntity',
120 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 121 'localizable' => 0,
a9d0587b 122 'add' => '4.6',
c3fc2621
CW
123 ],
124 'entity_table' => [
e501603b
TO
125 'name' => 'entity_table',
126 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 127 'title' => ts('Entity Table'),
215b423e 128 'description' => ts('Physical tablename for entity, e.g. civicrm_event'),
c3fc2621 129 'required' => TRUE,
e501603b
TO
130 'maxlength' => 64,
131 'size' => CRM_Utils_Type::BIG,
a36434b9 132 'where' => 'civicrm_recurring_entity.entity_table',
522a26c9 133 'table_name' => 'civicrm_recurring_entity',
134 'entity' => 'RecurringEntity',
135 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 136 'localizable' => 0,
a9d0587b 137 'add' => '4.6',
c3fc2621
CW
138 ],
139 'mode' => [
e501603b
TO
140 'name' => 'mode',
141 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 142 'title' => ts('Cascade Type'),
215b423e 143 'description' => ts('1-this entity, 2-this and the following entities, 3-all the entities'),
c3fc2621 144 'required' => TRUE,
a36434b9 145 'where' => 'civicrm_recurring_entity.mode',
e501603b 146 'default' => '1',
522a26c9 147 'table_name' => 'civicrm_recurring_entity',
148 'entity' => 'RecurringEntity',
149 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 150 'localizable' => 0,
a9d0587b 151 'add' => '4.6',
c3fc2621
CW
152 ],
153 ];
346aaaba 154 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 155 }
346aaaba 156 return Civi::$statics[__CLASS__]['fields'];
e501603b 157 }
c3fc2621 158
e501603b 159 /**
bd8e0b14 160 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
161 *
162 * @return array
bd8e0b14 163 * Array(string $name => string $uniqueName).
e501603b 164 */
c3fc2621 165 public static function &fieldKeys() {
bd8e0b14
TO
166 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
167 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 168 }
bd8e0b14 169 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 170 }
c3fc2621 171
e501603b
TO
172 /**
173 * Returns the names of this table
174 *
175 * @return string
176 */
c3fc2621 177 public static function getTableName() {
e501603b
TO
178 return self::$_tableName;
179 }
c3fc2621 180
e501603b
TO
181 /**
182 * Returns if this table needs to be logged
183 *
c3fc2621 184 * @return bool
e501603b 185 */
c3fc2621 186 public function getLog() {
e501603b
TO
187 return self::$_log;
188 }
c3fc2621 189
e501603b
TO
190 /**
191 * Returns the list of fields that can be imported
192 *
193 * @param bool $prefix
194 *
195 * @return array
196 */
c3fc2621
CW
197 public static function &import($prefix = FALSE) {
198 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'recurring_entity', $prefix, []);
60808919 199 return $r;
e501603b 200 }
c3fc2621 201
e501603b
TO
202 /**
203 * Returns the list of fields that can be exported
204 *
205 * @param bool $prefix
206 *
207 * @return array
208 */
c3fc2621
CW
209 public static function &export($prefix = FALSE) {
210 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'recurring_entity', $prefix, []);
60808919 211 return $r;
e501603b 212 }
c3fc2621 213
e7a6b91a
AS
214 /**
215 * Returns the list of indices
c3fc2621
CW
216 *
217 * @param bool $localize
218 *
219 * @return array
e7a6b91a
AS
220 */
221 public static function indices($localize = TRUE) {
c3fc2621 222 $indices = [];
e7a6b91a
AS
223 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
224 }
c3fc2621 225
e501603b 226}