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:0ae1df299c249c4984b5785593755400)
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',
115 'name' => 'event_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Event ID'),
118 'description' => ts('FK to Event ID'),
119 'where' => 'civicrm_events_in_carts.event_id',
120 'table_name' => 'civicrm_events_in_carts',
121 'entity' => 'EventInCart',
122 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
124 'FKClassName' => 'CRM_Event_DAO_Event',
126 'label' => ts("Event"),
131 'name' => 'event_cart_id',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Event Cart ID'),
134 'description' => ts('FK to Event Cart ID'),
135 'where' => 'civicrm_events_in_carts.event_cart_id',
136 'table_name' => 'civicrm_events_in_carts',
137 'entity' => 'EventInCart',
138 'bao' => 'CRM_Event_Cart_BAO_EventInCart',
140 'FKClassName' => 'CRM_Event_Cart_DAO_Cart',
142 'label' => ts("Event In Cart"),
147 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
149 return Civi
::$statics[__CLASS__
]['fields'];
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
156 * Array(string $name => string $uniqueName).
158 public static function &fieldKeys() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
160 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
162 return Civi
::$statics[__CLASS__
]['fieldKeys'];
166 * Returns the names of this table
170 public static function getTableName() {
171 return self
::$_tableName;
175 * Returns if this table needs to be logged
179 public function getLog() {
184 * Returns the list of fields that can be imported
186 * @param bool $prefix
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'events_in_carts', $prefix, []);
196 * Returns the list of fields that can be exported
198 * @param bool $prefix
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'events_in_carts', $prefix, []);
208 * Returns the list of indices
210 * @param bool $localize
214 public static function indices($localize = TRUE) {
216 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;