Merge pull request #11578 from jitendrapurohit/CRM-20697
[civicrm-core.git] / CRM / Core / DAO / RecurringEntity.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Core/RecurringEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:926c9bc8d5175511764721bc9dc8562a)
10 */
11
12 /**
13 * Database access object for the RecurringEntity entity.
14 */
15 class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 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 static $_log = TRUE;
30
31 /**
32 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * Recurring Entity Parent ID
38 *
39 * @var int unsigned
40 */
41 public $parent_id;
42
43 /**
44 * Recurring Entity Child ID
45 *
46 * @var int unsigned
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 boolean
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 all the column names of this table
74 *
75 * @return array
76 */
77 public static function &fields() {
78 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
79 Civi::$statics[__CLASS__]['fields'] = [
80 'id' => [
81 'name' => 'id',
82 'type' => CRM_Utils_Type::T_INT,
83 'title' => ts('ID'),
84 'required' => TRUE,
85 'table_name' => 'civicrm_recurring_entity',
86 'entity' => 'RecurringEntity',
87 'bao' => 'CRM_Core_BAO_RecurringEntity',
88 'localizable' => 0,
89 ],
90 'parent_id' => [
91 'name' => 'parent_id',
92 'type' => CRM_Utils_Type::T_INT,
93 'title' => ts('Parent ID'),
94 'description' => 'Recurring Entity Parent ID',
95 'required' => TRUE,
96 'table_name' => 'civicrm_recurring_entity',
97 'entity' => 'RecurringEntity',
98 'bao' => 'CRM_Core_BAO_RecurringEntity',
99 'localizable' => 0,
100 ],
101 'entity_id' => [
102 'name' => 'entity_id',
103 'type' => CRM_Utils_Type::T_INT,
104 'title' => ts('Entity ID'),
105 'description' => 'Recurring Entity Child ID',
106 'table_name' => 'civicrm_recurring_entity',
107 'entity' => 'RecurringEntity',
108 'bao' => 'CRM_Core_BAO_RecurringEntity',
109 'localizable' => 0,
110 ],
111 'entity_table' => [
112 'name' => 'entity_table',
113 'type' => CRM_Utils_Type::T_STRING,
114 'title' => ts('Entity Table'),
115 'description' => 'Physical tablename for entity, e.g. civicrm_event',
116 'required' => TRUE,
117 'maxlength' => 64,
118 'size' => CRM_Utils_Type::BIG,
119 'table_name' => 'civicrm_recurring_entity',
120 'entity' => 'RecurringEntity',
121 'bao' => 'CRM_Core_BAO_RecurringEntity',
122 'localizable' => 0,
123 ],
124 'mode' => [
125 'name' => 'mode',
126 'type' => CRM_Utils_Type::T_BOOLEAN,
127 'title' => ts('Cascade Type'),
128 'description' => '1-this entity, 2-this and the following entities, 3-all the entities',
129 'required' => TRUE,
130 'default' => '1',
131 'table_name' => 'civicrm_recurring_entity',
132 'entity' => 'RecurringEntity',
133 'bao' => 'CRM_Core_BAO_RecurringEntity',
134 'localizable' => 0,
135 ],
136 ];
137 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
138 }
139 return Civi::$statics[__CLASS__]['fields'];
140 }
141
142 /**
143 * Return a mapping from field-name to the corresponding key (as used in fields()).
144 *
145 * @return array
146 * Array(string $name => string $uniqueName).
147 */
148 public static function &fieldKeys() {
149 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
150 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
151 }
152 return Civi::$statics[__CLASS__]['fieldKeys'];
153 }
154
155 /**
156 * Returns the names of this table
157 *
158 * @return string
159 */
160 public static function getTableName() {
161 return self::$_tableName;
162 }
163
164 /**
165 * Returns if this table needs to be logged
166 *
167 * @return bool
168 */
169 public function getLog() {
170 return self::$_log;
171 }
172
173 /**
174 * Returns the list of fields that can be imported
175 *
176 * @param bool $prefix
177 *
178 * @return array
179 */
180 public static function &import($prefix = FALSE) {
181 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'recurring_entity', $prefix, []);
182 return $r;
183 }
184
185 /**
186 * Returns the list of fields that can be exported
187 *
188 * @param bool $prefix
189 *
190 * @return array
191 */
192 public static function &export($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'recurring_entity', $prefix, []);
194 return $r;
195 }
196
197 /**
198 * Returns the list of indices
199 *
200 * @param bool $localize
201 *
202 * @return array
203 */
204 public static function indices($localize = TRUE) {
205 $indices = [];
206 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
207 }
208
209 }