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:57220a9c79c8b801d23ed0c31cb18a63)
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 foreign keys and entity references.
62 * [CRM_Core_Reference_Interface]
64 public static function getReferenceColumns() {
65 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
66 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
67 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'user_id', 'civicrm_contact', 'id');
68 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
70 return Civi
::$statics[__CLASS__
]['links'];
74 * Returns all the column names of this table
78 public static function &fields() {
79 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
80 Civi
::$statics[__CLASS__
]['fields'] = [
83 'type' => CRM_Utils_Type
::T_INT
,
84 'title' => ts('Cart ID'),
85 'description' => ts('Cart Id'),
87 'where' => 'civicrm_event_carts.id',
88 'table_name' => 'civicrm_event_carts',
90 'bao' => 'CRM_Event_Cart_BAO_Cart',
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Created By'),
97 'description' => ts('FK to civicrm_contact who created this cart'),
98 'where' => 'civicrm_event_carts.user_id',
99 'table_name' => 'civicrm_event_carts',
101 'bao' => 'CRM_Event_Cart_BAO_Cart',
103 'FKClassName' => 'CRM_Contact_DAO_Contact',
106 'name' => 'completed',
107 'type' => CRM_Utils_Type
::T_BOOLEAN
,
108 'title' => ts('Complete?'),
109 'where' => 'civicrm_event_carts.completed',
111 'table_name' => 'civicrm_event_carts',
113 'bao' => 'CRM_Event_Cart_BAO_Cart',
117 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
119 return Civi
::$statics[__CLASS__
]['fields'];
123 * Return a mapping from field-name to the corresponding key (as used in fields()).
126 * Array(string $name => string $uniqueName).
128 public static function &fieldKeys() {
129 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
130 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
132 return Civi
::$statics[__CLASS__
]['fieldKeys'];
136 * Returns the names of this table
140 public static function getTableName() {
141 return self
::$_tableName;
145 * Returns if this table needs to be logged
149 public function getLog() {
154 * Returns the list of fields that can be imported
156 * @param bool $prefix
160 public static function &import($prefix = FALSE) {
161 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'event_carts', $prefix, []);
166 * Returns the list of fields that can be exported
168 * @param bool $prefix
172 public static function &export($prefix = FALSE) {
173 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'event_carts', $prefix, []);
178 * Returns the list of indices
180 * @param bool $localize
184 public static function indices($localize = TRUE) {
186 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;