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