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:edd6f68d78455072c15bcb051abc98f9)
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',
111 'name' => 'event_id',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Event'),
114 'description' => ts('FK to Event ID'),
115 'where' => 'civicrm_events_in_carts.event_id',
116 'table_name' => 'civicrm_events_in_carts',
117 'entity' => 'EventInCart',
118 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
120 'FKClassName' => 'CRM_Event_DAO_Event',
124 'name' => 'event_cart_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Event In Cart'),
127 'description' => ts('FK to Event Cart ID'),
128 'where' => 'civicrm_events_in_carts.event_cart_id',
129 'table_name' => 'civicrm_events_in_carts',
130 'entity' => 'EventInCart',
131 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
133 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
137 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
139 return Civi
::$statics[__CLASS__
]['fields'];
143 * Return a mapping from field-name to the corresponding key (as used in fields()).
146 * Array(string $name => string $uniqueName).
148 public static function &fieldKeys() {
149 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
150 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
152 return Civi
::$statics[__CLASS__
]['fieldKeys'];
156 * Returns the names of this table
160 public static function getTableName() {
161 return self
::$_tableName;
165 * Returns if this table needs to be logged
169 public function getLog() {
174 * Returns the list of fields that can be imported
176 * @param bool $prefix
180 public static function &import($prefix = FALSE) {
181 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'events_in_carts', $prefix, []);
186 * Returns the list of fields that can be exported
188 * @param bool $prefix
192 public static function &export($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'events_in_carts', $prefix, []);
198 * Returns the list of indices
200 * @param bool $localize
204 public static function indices($localize = TRUE) {
206 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;