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:b7a4ad0bbb09a64b8afefd7a1a2d6a9b)
13 * Database access object for the Cart entity.
15 class CRM_Event_Cart_DAO_Cart
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_event_carts';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * FK to civicrm_contact who created this cart
55 public function __construct() {
56 $this->__table
= 'civicrm_event_carts';
57 parent
::__construct();
61 * Returns localized title of this entity.
64 * Whether to return the plural version of the title.
66 public static function getEntityTitle($plural = FALSE) {
67 return $plural ?
ts('Carts') : ts('Cart');
71 * Returns foreign keys and entity references.
74 * [CRM_Core_Reference_Interface]
76 public static function getReferenceColumns() {
77 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
78 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'user_id', 'civicrm_contact', 'id');
80 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Cart ID'),
97 'description' => ts('Cart Id'),
99 'where' => 'civicrm_event_carts.id',
100 'table_name' => 'civicrm_event_carts',
102 'bao' => 'CRM_Event_Cart_BAO_Cart',
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Created By'),
110 'description' => ts('FK to civicrm_contact who created this cart'),
111 'where' => 'civicrm_event_carts.user_id',
112 'table_name' => 'civicrm_event_carts',
114 'bao' => 'CRM_Event_Cart_BAO_Cart',
116 'FKClassName' => 'CRM_Contact_DAO_Contact',
120 'name' => 'completed',
121 'type' => CRM_Utils_Type
::T_BOOLEAN
,
122 'title' => ts('Complete?'),
123 'where' => 'civicrm_event_carts.completed',
125 'table_name' => 'civicrm_event_carts',
127 'bao' => 'CRM_Event_Cart_BAO_Cart',
132 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
134 return Civi
::$statics[__CLASS__
]['fields'];
138 * Return a mapping from field-name to the corresponding key (as used in fields()).
141 * Array(string $name => string $uniqueName).
143 public static function &fieldKeys() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
145 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
147 return Civi
::$statics[__CLASS__
]['fieldKeys'];
151 * Returns the names of this table
155 public static function getTableName() {
156 return self
::$_tableName;
160 * Returns if this table needs to be logged
164 public function getLog() {
169 * Returns the list of fields that can be imported
171 * @param bool $prefix
175 public static function &import($prefix = FALSE) {
176 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'event_carts', $prefix, []);
181 * Returns the list of fields that can be exported
183 * @param bool $prefix
187 public static function &export($prefix = FALSE) {
188 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'event_carts', $prefix, []);
193 * Returns the list of indices
195 * @param bool $localize
199 public static function indices($localize = TRUE) {
201 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;