Regenerate DAO files
[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:9b3e4e7cc1a1bd76029eeaccb041b5cd)
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 'add' => '4.1',
112 ],
113 'event_id' => [
114 'name' => 'event_id',
115 'type' => CRM_Utils_Type::T_INT,
116 'title' => ts('Event ID'),
117 'description' => ts('FK to Event ID'),
118 'where' => 'civicrm_events_in_carts.event_id',
119 'table_name' => 'civicrm_events_in_carts',
120 'entity' => 'EventInCart',
121 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
122 'localizable' => 0,
123 'FKClassName' => 'CRM_Event_DAO_Event',
124 'html' => [
125 'label' => ts("Event"),
126 ],
127 'add' => '4.1',
128 ],
129 'event_cart_id' => [
130 'name' => 'event_cart_id',
131 'type' => CRM_Utils_Type::T_INT,
132 'title' => ts('Event Cart ID'),
133 'description' => ts('FK to Event Cart ID'),
134 'where' => 'civicrm_events_in_carts.event_cart_id',
135 'table_name' => 'civicrm_events_in_carts',
136 'entity' => 'EventInCart',
137 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
138 'localizable' => 0,
139 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
140 'html' => [
141 'label' => ts("Event In Cart"),
142 ],
143 'add' => '4.1',
144 ],
145 ];
146 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
147 }
148 return Civi::$statics[__CLASS__]['fields'];
149 }
150
151 /**
152 * Return a mapping from field-name to the corresponding key (as used in fields()).
153 *
154 * @return array
155 * Array(string $name => string $uniqueName).
156 */
157 public static function &fieldKeys() {
158 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
159 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
160 }
161 return Civi::$statics[__CLASS__]['fieldKeys'];
162 }
163
164 /**
165 * Returns the names of this table
166 *
167 * @return string
168 */
169 public static function getTableName() {
170 return self::$_tableName;
171 }
172
173 /**
174 * Returns if this table needs to be logged
175 *
176 * @return bool
177 */
178 public function getLog() {
179 return self::$_log;
180 }
181
182 /**
183 * Returns the list of fields that can be imported
184 *
185 * @param bool $prefix
186 *
187 * @return array
188 */
189 public static function &import($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'events_in_carts', $prefix, []);
191 return $r;
192 }
193
194 /**
195 * Returns the list of fields that can be exported
196 *
197 * @param bool $prefix
198 *
199 * @return array
200 */
201 public static function &export($prefix = FALSE) {
202 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'events_in_carts', $prefix, []);
203 return $r;
204 }
205
206 /**
207 * Returns the list of indices
208 *
209 * @param bool $localize
210 *
211 * @return array
212 */
213 public static function indices($localize = TRUE) {
214 $indices = [];
215 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
216 }
217
218 }