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