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