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