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:ef07999cbb7872dc9c1cfa6a0055bee1)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_events_in_carts';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
52 public $event_cart_id;
57 public function __construct() {
58 $this->__table
= 'civicrm_events_in_carts';
59 parent
::__construct();
63 * Returns localized title of this entity.
66 * Whether to return the plural version of the title.
68 public static function getEntityTitle($plural = FALSE) {
69 return $plural ?
ts('Event In Carts') : ts('Event In Cart');
73 * Returns foreign keys and entity references.
76 * [CRM_Core_Reference_Interface]
78 public static function getReferenceColumns() {
79 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
80 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
81 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_id', 'civicrm_event', 'id');
82 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_cart_id', 'civicrm_event_carts', 'id');
83 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
85 return Civi
::$statics[__CLASS__
]['links'];
89 * Returns all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
96 'event_in_cart_id' => [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Event In Cart'),
100 'description' => ts('Event In Cart Id'),
102 'where' => 'civicrm_events_in_carts.id',
103 'table_name' => 'civicrm_events_in_carts',
104 'entity' => 'EventInCart',
105 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
110 'name' => 'event_id',
111 'type' => CRM_Utils_Type
::T_INT
,
112 'title' => ts('Event'),
113 'description' => ts('FK to Event ID'),
114 'where' => 'civicrm_events_in_carts.event_id',
115 'table_name' => 'civicrm_events_in_carts',
116 'entity' => 'EventInCart',
117 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
119 'FKClassName' => 'CRM_Event_DAO_Event',
123 'name' => 'event_cart_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Event In Cart'),
126 'description' => ts('FK to Event Cart ID'),
127 'where' => 'civicrm_events_in_carts.event_cart_id',
128 'table_name' => 'civicrm_events_in_carts',
129 'entity' => 'EventInCart',
130 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
132 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
138 return Civi
::$statics[__CLASS__
]['fields'];
142 * Return a mapping from field-name to the corresponding key (as used in fields()).
145 * Array(string $name => string $uniqueName).
147 public static function &fieldKeys() {
148 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
149 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
151 return Civi
::$statics[__CLASS__
]['fieldKeys'];
155 * Returns the names of this table
159 public static function getTableName() {
160 return self
::$_tableName;
164 * Returns if this table needs to be logged
168 public function getLog() {
173 * Returns the list of fields that can be imported
175 * @param bool $prefix
179 public static function &import($prefix = FALSE) {
180 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'events_in_carts', $prefix, []);
185 * Returns the list of fields that can be exported
187 * @param bool $prefix
191 public static function &export($prefix = FALSE) {
192 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'events_in_carts', $prefix, []);
197 * Returns the list of indices
199 * @param bool $localize
203 public static function indices($localize = TRUE) {
205 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;