5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Event/Cart/EventInCart.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9b3e4e7cc1a1bd76029eeaccb041b5cd)
13 * Database access object for the EventInCart entity.
15 class CRM_Event_Cart_DAO_EventInCart
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviEvent';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_events_in_carts';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
53 public $event_cart_id;
58 public function __construct() {
59 $this->__table
= 'civicrm_events_in_carts';
60 parent
::__construct();
64 * Returns localized title of this entity.
67 * Whether to return the plural version of the title.
69 public static function getEntityTitle($plural = FALSE) {
70 return $plural ?
ts('Event In Carts') : ts('Event In Cart');
74 * Returns foreign keys and entity references.
77 * [CRM_Core_Reference_Interface]
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']);
86 return Civi
::$statics[__CLASS__
]['links'];
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
97 'event_in_cart_id' => [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('Event In Cart'),
101 'description' => ts('Event In Cart ID'),
103 'where' => 'civicrm_events_in_carts.id',
104 'table_name' => 'civicrm_events_in_carts',
105 'entity' => 'EventInCart',
106 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
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',
123 'FKClassName' => 'CRM_Event_DAO_Event',
125 'label' => ts("Event"),
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',
139 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
141 'label' => ts("Event In Cart"),
146 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
148 return Civi
::$statics[__CLASS__
]['fields'];
152 * Return a mapping from field-name to the corresponding key (as used in fields()).
155 * Array(string $name => string $uniqueName).
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()));
161 return Civi
::$statics[__CLASS__
]['fieldKeys'];
165 * Returns the names of this table
169 public static function getTableName() {
170 return self
::$_tableName;
174 * Returns if this table needs to be logged
178 public function getLog() {
183 * Returns the list of fields that can be imported
185 * @param bool $prefix
189 public static function &import($prefix = FALSE) {
190 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'events_in_carts', $prefix, []);
195 * Returns the list of fields that can be exported
197 * @param bool $prefix
201 public static function &export($prefix = FALSE) {
202 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'events_in_carts', $prefix, []);
207 * Returns the list of indices
209 * @param bool $localize
213 public static function indices($localize = TRUE) {
215 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;