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