Commit | Line | Data |
---|---|---|
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 | |
449c4e6b | 9 | * (GenCodeChecksum:6321192add109bdc0211b72cc49e3611) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the RecurringEntity entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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, |
c3fc2621 CW |
97 | ], |
98 | 'parent_id' => [ | |
e501603b TO |
99 | 'name' => 'parent_id', |
100 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 101 | 'title' => ts('Parent ID'), |
215b423e | 102 | 'description' => ts('Recurring Entity Parent ID'), |
c3fc2621 | 103 | 'required' => TRUE, |
a36434b9 | 104 | 'where' => 'civicrm_recurring_entity.parent_id', |
522a26c9 | 105 | 'table_name' => 'civicrm_recurring_entity', |
106 | 'entity' => 'RecurringEntity', | |
107 | 'bao' => 'CRM_Core_BAO_RecurringEntity', | |
6a7e5e5d | 108 | 'localizable' => 0, |
c3fc2621 CW |
109 | ], |
110 | 'entity_id' => [ | |
e501603b TO |
111 | 'name' => 'entity_id', |
112 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 113 | 'title' => ts('Entity ID'), |
215b423e | 114 | 'description' => ts('Recurring Entity Child ID'), |
a36434b9 | 115 | 'where' => 'civicrm_recurring_entity.entity_id', |
522a26c9 | 116 | 'table_name' => 'civicrm_recurring_entity', |
117 | 'entity' => 'RecurringEntity', | |
118 | 'bao' => 'CRM_Core_BAO_RecurringEntity', | |
6a7e5e5d | 119 | 'localizable' => 0, |
c3fc2621 CW |
120 | ], |
121 | 'entity_table' => [ | |
e501603b TO |
122 | 'name' => 'entity_table', |
123 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 124 | 'title' => ts('Entity Table'), |
215b423e | 125 | 'description' => ts('Physical tablename for entity, e.g. civicrm_event'), |
c3fc2621 | 126 | 'required' => TRUE, |
e501603b TO |
127 | 'maxlength' => 64, |
128 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 129 | 'where' => 'civicrm_recurring_entity.entity_table', |
522a26c9 | 130 | 'table_name' => 'civicrm_recurring_entity', |
131 | 'entity' => 'RecurringEntity', | |
132 | 'bao' => 'CRM_Core_BAO_RecurringEntity', | |
6a7e5e5d | 133 | 'localizable' => 0, |
c3fc2621 CW |
134 | ], |
135 | 'mode' => [ | |
e501603b TO |
136 | 'name' => 'mode', |
137 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 138 | 'title' => ts('Cascade Type'), |
215b423e | 139 | 'description' => ts('1-this entity, 2-this and the following entities, 3-all the entities'), |
c3fc2621 | 140 | 'required' => TRUE, |
a36434b9 | 141 | 'where' => 'civicrm_recurring_entity.mode', |
e501603b | 142 | 'default' => '1', |
522a26c9 | 143 | 'table_name' => 'civicrm_recurring_entity', |
144 | 'entity' => 'RecurringEntity', | |
145 | 'bao' => 'CRM_Core_BAO_RecurringEntity', | |
6a7e5e5d | 146 | 'localizable' => 0, |
c3fc2621 CW |
147 | ], |
148 | ]; | |
346aaaba | 149 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 150 | } |
346aaaba | 151 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 152 | } |
c3fc2621 | 153 | |
e501603b | 154 | /** |
bd8e0b14 | 155 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
156 | * |
157 | * @return array | |
bd8e0b14 | 158 | * Array(string $name => string $uniqueName). |
e501603b | 159 | */ |
c3fc2621 | 160 | public static function &fieldKeys() { |
bd8e0b14 TO |
161 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
162 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 163 | } |
bd8e0b14 | 164 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 165 | } |
c3fc2621 | 166 | |
e501603b TO |
167 | /** |
168 | * Returns the names of this table | |
169 | * | |
170 | * @return string | |
171 | */ | |
c3fc2621 | 172 | public static function getTableName() { |
e501603b TO |
173 | return self::$_tableName; |
174 | } | |
c3fc2621 | 175 | |
e501603b TO |
176 | /** |
177 | * Returns if this table needs to be logged | |
178 | * | |
c3fc2621 | 179 | * @return bool |
e501603b | 180 | */ |
c3fc2621 | 181 | public function getLog() { |
e501603b TO |
182 | return self::$_log; |
183 | } | |
c3fc2621 | 184 | |
e501603b TO |
185 | /** |
186 | * Returns the list of fields that can be imported | |
187 | * | |
188 | * @param bool $prefix | |
189 | * | |
190 | * @return array | |
191 | */ | |
c3fc2621 CW |
192 | public static function &import($prefix = FALSE) { |
193 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'recurring_entity', $prefix, []); | |
60808919 | 194 | return $r; |
e501603b | 195 | } |
c3fc2621 | 196 | |
e501603b TO |
197 | /** |
198 | * Returns the list of fields that can be exported | |
199 | * | |
200 | * @param bool $prefix | |
201 | * | |
202 | * @return array | |
203 | */ | |
c3fc2621 CW |
204 | public static function &export($prefix = FALSE) { |
205 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'recurring_entity', $prefix, []); | |
60808919 | 206 | return $r; |
e501603b | 207 | } |
c3fc2621 | 208 | |
e7a6b91a AS |
209 | /** |
210 | * Returns the list of indices | |
c3fc2621 CW |
211 | * |
212 | * @param bool $localize | |
213 | * | |
214 | * @return array | |
e7a6b91a AS |
215 | */ |
216 | public static function indices($localize = TRUE) { | |
c3fc2621 | 217 | $indices = []; |
e7a6b91a AS |
218 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
219 | } | |
c3fc2621 | 220 | |
e501603b | 221 | } |