API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Event / Cart / DAO / EventInCart.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/Event/Cart/EventInCart.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
a9d0587b 9 * (GenCodeChecksum:a995a300028b34f7b866a41b2e2b96bf)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the EventInCart entity.
f41f0342 14 */
e501603b 15class CRM_Event_Cart_DAO_EventInCart 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_events_in_carts';
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 = FALSE;
c3fc2621 30
e501603b
TO
31 /**
32 * Event In Cart Id
33 *
e6ca0a57 34 * @var int
e501603b
TO
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * FK to Event ID
40 *
e6ca0a57 41 * @var int
e501603b
TO
42 */
43 public $event_id;
c3fc2621 44
e501603b
TO
45 /**
46 * FK to Event Cart ID
47 *
e6ca0a57 48 * @var int
e501603b
TO
49 */
50 public $event_cart_id;
c3fc2621 51
e501603b 52 /**
f41f0342 53 * Class constructor.
e501603b 54 */
c3fc2621 55 public function __construct() {
e501603b
TO
56 $this->__table = 'civicrm_events_in_carts';
57 parent::__construct();
58 }
c3fc2621 59
449c4e6b
CW
60 /**
61 * Returns localized title of this entity.
62 */
63 public static function getEntityTitle() {
64 return ts('Event In Carts');
65 }
66
e501603b 67 /**
f41f0342 68 * Returns foreign keys and entity references.
e501603b
TO
69 *
70 * @return array
71 * [CRM_Core_Reference_Interface]
72 */
c3fc2621 73 public static function getReferenceColumns() {
346aaaba 74 if (!isset(Civi::$statics[__CLASS__]['links'])) {
a36434b9 75 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
76 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_id', 'civicrm_event', 'id');
77 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_cart_id', 'civicrm_event_carts', 'id');
346aaaba 78 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 79 }
346aaaba 80 return Civi::$statics[__CLASS__]['links'];
e501603b 81 }
c3fc2621 82
e501603b
TO
83 /**
84 * Returns all the column names of this table
85 *
86 * @return array
87 */
c3fc2621 88 public static function &fields() {
346aaaba 89 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
90 Civi::$statics[__CLASS__]['fields'] = [
91 'event_in_cart_id' => [
e501603b
TO
92 'name' => 'id',
93 'type' => CRM_Utils_Type::T_INT,
c3fc2621 94 'title' => ts('Event In Cart'),
215b423e 95 'description' => ts('Event In Cart Id'),
c3fc2621 96 'required' => TRUE,
a36434b9 97 'where' => 'civicrm_events_in_carts.id',
522a26c9 98 'table_name' => 'civicrm_events_in_carts',
99 'entity' => 'EventInCart',
100 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
6a7e5e5d 101 'localizable' => 0,
a9d0587b 102 'add' => '4.1',
c3fc2621
CW
103 ],
104 'event_id' => [
e501603b
TO
105 'name' => 'event_id',
106 'type' => CRM_Utils_Type::T_INT,
c3fc2621 107 'title' => ts('Event'),
215b423e 108 'description' => ts('FK to Event ID'),
a36434b9 109 'where' => 'civicrm_events_in_carts.event_id',
522a26c9 110 'table_name' => 'civicrm_events_in_carts',
111 'entity' => 'EventInCart',
112 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
6a7e5e5d 113 'localizable' => 0,
e501603b 114 'FKClassName' => 'CRM_Event_DAO_Event',
a9d0587b 115 'add' => '4.1',
c3fc2621
CW
116 ],
117 'event_cart_id' => [
e501603b
TO
118 'name' => 'event_cart_id',
119 'type' => CRM_Utils_Type::T_INT,
c3fc2621 120 'title' => ts('Event In Cart'),
215b423e 121 'description' => ts('FK to Event Cart ID'),
a36434b9 122 'where' => 'civicrm_events_in_carts.event_cart_id',
522a26c9 123 'table_name' => 'civicrm_events_in_carts',
124 'entity' => 'EventInCart',
125 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
6a7e5e5d 126 'localizable' => 0,
e501603b 127 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
a9d0587b 128 'add' => '4.1',
c3fc2621
CW
129 ],
130 ];
346aaaba 131 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 132 }
346aaaba 133 return Civi::$statics[__CLASS__]['fields'];
e501603b 134 }
c3fc2621 135
e501603b 136 /**
bd8e0b14 137 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
138 *
139 * @return array
bd8e0b14 140 * Array(string $name => string $uniqueName).
e501603b 141 */
c3fc2621 142 public static function &fieldKeys() {
bd8e0b14
TO
143 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
144 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 145 }
bd8e0b14 146 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 147 }
c3fc2621 148
e501603b
TO
149 /**
150 * Returns the names of this table
151 *
152 * @return string
153 */
c3fc2621 154 public static function getTableName() {
e501603b
TO
155 return self::$_tableName;
156 }
c3fc2621 157
e501603b
TO
158 /**
159 * Returns if this table needs to be logged
160 *
c3fc2621 161 * @return bool
e501603b 162 */
c3fc2621 163 public function getLog() {
e501603b
TO
164 return self::$_log;
165 }
c3fc2621 166
e501603b
TO
167 /**
168 * Returns the list of fields that can be imported
169 *
170 * @param bool $prefix
171 *
172 * @return array
173 */
c3fc2621
CW
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'events_in_carts', $prefix, []);
60808919 176 return $r;
e501603b 177 }
c3fc2621 178
e501603b
TO
179 /**
180 * Returns the list of fields that can be exported
181 *
182 * @param bool $prefix
183 *
184 * @return array
185 */
c3fc2621
CW
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'events_in_carts', $prefix, []);
60808919 188 return $r;
e501603b 189 }
c3fc2621 190
e7a6b91a
AS
191 /**
192 * Returns the list of indices
c3fc2621
CW
193 *
194 * @param bool $localize
195 *
196 * @return array
e7a6b91a
AS
197 */
198 public static function indices($localize = TRUE) {
c3fc2621 199 $indices = [];
e7a6b91a
AS
200 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
201 }
c3fc2621 202
e501603b 203}