Merge pull request #20471 from eileenmcnaughton/schema
[civicrm-core.git] / CRM / Event / Cart / DAO / EventInCart.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Event/Cart/EventInCart.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:872f4e67be93efbed14721bb030227db)
10 */
11
12 /**
13 * Database access object for the EventInCart entity.
14 */
15 class CRM_Event_Cart_DAO_EventInCart extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '';
18 const COMPONENT = 'CiviEvent';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_events_in_carts';
26
27 /**
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 *
30 * @var bool
31 */
32 public static $_log = FALSE;
33
34 /**
35 * Event In Cart ID
36 *
37 * @var int
38 */
39 public $id;
40
41 /**
42 * FK to Event ID
43 *
44 * @var int
45 */
46 public $event_id;
47
48 /**
49 * FK to Event Cart ID
50 *
51 * @var int
52 */
53 public $event_cart_id;
54
55 /**
56 * Class constructor.
57 */
58 public function __construct() {
59 $this->__table = 'civicrm_events_in_carts';
60 parent::__construct();
61 }
62
63 /**
64 * Returns localized title of this entity.
65 *
66 * @param bool $plural
67 * Whether to return the plural version of the title.
68 */
69 public static function getEntityTitle($plural = FALSE) {
70 return $plural ? ts('Event In Carts') : ts('Event In Cart');
71 }
72
73 /**
74 * Returns foreign keys and entity references.
75 *
76 * @return array
77 * [CRM_Core_Reference_Interface]
78 */
79 public static function getReferenceColumns() {
80 if (!isset(Civi::$statics[__CLASS__]['links'])) {
81 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
82 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_id', 'civicrm_event', 'id');
83 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_cart_id', 'civicrm_event_carts', 'id');
84 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
85 }
86 return Civi::$statics[__CLASS__]['links'];
87 }
88
89 /**
90 * Returns all the column names of this table
91 *
92 * @return array
93 */
94 public static function &fields() {
95 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
96 Civi::$statics[__CLASS__]['fields'] = [
97 'event_in_cart_id' => [
98 'name' => 'id',
99 'type' => CRM_Utils_Type::T_INT,
100 'title' => ts('Event In Cart'),
101 'description' => ts('Event In Cart ID'),
102 'required' => TRUE,
103 'where' => 'civicrm_events_in_carts.id',
104 'table_name' => 'civicrm_events_in_carts',
105 'entity' => 'EventInCart',
106 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
107 'localizable' => 0,
108 'html' => [
109 'type' => 'Number',
110 ],
111 'readonly' => TRUE,
112 'add' => '4.1',
113 ],
114 'event_id' => [
115 'name' => 'event_id',
116 'type' => CRM_Utils_Type::T_INT,
117 'title' => ts('Event ID'),
118 'description' => ts('FK to Event ID'),
119 'where' => 'civicrm_events_in_carts.event_id',
120 'table_name' => 'civicrm_events_in_carts',
121 'entity' => 'EventInCart',
122 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
123 'localizable' => 0,
124 'FKClassName' => 'CRM_Event_DAO_Event',
125 'html' => [
126 'label' => ts("Event"),
127 ],
128 'add' => '4.1',
129 ],
130 'event_cart_id' => [
131 'name' => 'event_cart_id',
132 'type' => CRM_Utils_Type::T_INT,
133 'title' => ts('Event Cart ID'),
134 'description' => ts('FK to Event Cart ID'),
135 'where' => 'civicrm_events_in_carts.event_cart_id',
136 'table_name' => 'civicrm_events_in_carts',
137 'entity' => 'EventInCart',
138 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
139 'localizable' => 0,
140 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
141 'html' => [
142 'label' => ts("Event In Cart"),
143 ],
144 'add' => '4.1',
145 ],
146 ];
147 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
148 }
149 return Civi::$statics[__CLASS__]['fields'];
150 }
151
152 /**
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
154 *
155 * @return array
156 * Array(string $name => string $uniqueName).
157 */
158 public static function &fieldKeys() {
159 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
160 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
161 }
162 return Civi::$statics[__CLASS__]['fieldKeys'];
163 }
164
165 /**
166 * Returns the names of this table
167 *
168 * @return string
169 */
170 public static function getTableName() {
171 return self::$_tableName;
172 }
173
174 /**
175 * Returns if this table needs to be logged
176 *
177 * @return bool
178 */
179 public function getLog() {
180 return self::$_log;
181 }
182
183 /**
184 * Returns the list of fields that can be imported
185 *
186 * @param bool $prefix
187 *
188 * @return array
189 */
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'events_in_carts', $prefix, []);
192 return $r;
193 }
194
195 /**
196 * Returns the list of fields that can be exported
197 *
198 * @param bool $prefix
199 *
200 * @return array
201 */
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'events_in_carts', $prefix, []);
204 return $r;
205 }
206
207 /**
208 * Returns the list of indices
209 *
210 * @param bool $localize
211 *
212 * @return array
213 */
214 public static function indices($localize = TRUE) {
215 $indices = [];
216 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
217 }
218
219 }