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:ff4dc6dfd849ffb9b89627be860bad2b)
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',
102 'type' => CRM_Utils_Type
::T_INT
,
103 'title' => ts('Created By'),
104 'description' => ts('FK to civicrm_contact who created this cart'),
105 'where' => 'civicrm_event_carts.user_id',
106 'table_name' => 'civicrm_event_carts',
108 'bao' => 'CRM_Event_Cart_BAO_Cart',
110 'FKClassName' => 'CRM_Contact_DAO_Contact',
113 'name' => 'completed',
114 'type' => CRM_Utils_Type
::T_BOOLEAN
,
115 'title' => ts('Complete?'),
116 'where' => 'civicrm_event_carts.completed',
118 'table_name' => 'civicrm_event_carts',
120 'bao' => 'CRM_Event_Cart_BAO_Cart',
124 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
126 return Civi
::$statics[__CLASS__
]['fields'];
130 * Return a mapping from field-name to the corresponding key (as used in fields()).
133 * Array(string $name => string $uniqueName).
135 public static function &fieldKeys() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
137 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
139 return Civi
::$statics[__CLASS__
]['fieldKeys'];
143 * Returns the names of this table
147 public static function getTableName() {
148 return self
::$_tableName;
152 * Returns if this table needs to be logged
156 public function getLog() {
161 * Returns the list of fields that can be imported
163 * @param bool $prefix
167 public static function &import($prefix = FALSE) {
168 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'event_carts', $prefix, []);
173 * Returns the list of fields that can be exported
175 * @param bool $prefix
179 public static function &export($prefix = FALSE) {
180 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'event_carts', $prefix, []);
185 * Returns the list of indices
187 * @param bool $localize
191 public static function indices($localize = TRUE) {
193 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;