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