5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Event/Cart/Cart.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c0fdef43850965dce80a73e66caa3ceb)
13 * Database access object for the Cart entity.
15 class CRM_Event_Cart_DAO_Cart
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_event_carts';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * FK to civicrm_contact who created this cart
53 public function __construct() {
54 $this->__table
= 'civicrm_event_carts';
55 parent
::__construct();
59 * Returns localized title of this entity.
61 public static function getEntityTitle() {
66 * Returns foreign keys and entity references.
69 * [CRM_Core_Reference_Interface]
71 public static function getReferenceColumns() {
72 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
73 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
74 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'user_id', 'civicrm_contact', 'id');
75 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
77 return Civi
::$statics[__CLASS__
]['links'];
81 * Returns all the column names of this table
85 public static function &fields() {
86 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
87 Civi
::$statics[__CLASS__
]['fields'] = [
90 'type' => CRM_Utils_Type
::T_INT
,
91 'title' => ts('Cart ID'),
92 'description' => ts('Cart Id'),
94 'where' => 'civicrm_event_carts.id',
95 'table_name' => 'civicrm_event_carts',
97 'bao' => 'CRM_Event_Cart_BAO_Cart',
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Created By'),
105 'description' => ts('FK to civicrm_contact who created this cart'),
106 'where' => 'civicrm_event_carts.user_id',
107 'table_name' => 'civicrm_event_carts',
109 'bao' => 'CRM_Event_Cart_BAO_Cart',
111 'FKClassName' => 'CRM_Contact_DAO_Contact',
115 'name' => 'completed',
116 'type' => CRM_Utils_Type
::T_BOOLEAN
,
117 'title' => ts('Complete?'),
118 'where' => 'civicrm_event_carts.completed',
120 'table_name' => 'civicrm_event_carts',
122 'bao' => 'CRM_Event_Cart_BAO_Cart',
127 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
129 return Civi
::$statics[__CLASS__
]['fields'];
133 * Return a mapping from field-name to the corresponding key (as used in fields()).
136 * Array(string $name => string $uniqueName).
138 public static function &fieldKeys() {
139 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
140 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
142 return Civi
::$statics[__CLASS__
]['fieldKeys'];
146 * Returns the names of this table
150 public static function getTableName() {
151 return self
::$_tableName;
155 * Returns if this table needs to be logged
159 public function getLog() {
164 * Returns the list of fields that can be imported
166 * @param bool $prefix
170 public static function &import($prefix = FALSE) {
171 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'event_carts', $prefix, []);
176 * Returns the list of fields that can be exported
178 * @param bool $prefix
182 public static function &export($prefix = FALSE) {
183 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'event_carts', $prefix, []);
188 * Returns the list of indices
190 * @param bool $localize
194 public static function indices($localize = TRUE) {
196 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;