5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Case/CaseActivity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:473d4047af6f44f1082795d38ef3ff4d)
13 * Database access object for the CaseActivity entity.
15 class CRM_Case_DAO_CaseActivity
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.8';
18 const COMPONENT
= 'CiviCase';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_case_activity';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
35 * Unique case-activity association id
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
44 * Case ID of case-activity association.
47 * (SQL type: int unsigned)
48 * Note that values will be retrieved from the database as a string.
53 * Activity ID of case-activity association.
56 * (SQL type: int unsigned)
57 * Note that values will be retrieved from the database as a string.
64 public function __construct() {
65 $this->__table
= 'civicrm_case_activity';
66 parent
::__construct();
70 * Returns localized title of this entity.
73 * Whether to return the plural version of the title.
75 public static function getEntityTitle($plural = FALSE) {
76 return $plural ?
ts('Case Activities') : ts('Case Activity');
80 * Returns foreign keys and entity references.
83 * [CRM_Core_Reference_Interface]
85 public static function getReferenceColumns() {
86 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
87 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
88 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'case_id', 'civicrm_case', 'id');
89 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'activity_id', 'civicrm_activity', 'id');
90 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
92 return Civi
::$statics[__CLASS__
]['links'];
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Case Activity ID'),
107 'description' => ts('Unique case-activity association id'),
109 'where' => 'civicrm_case_activity.id',
110 'table_name' => 'civicrm_case_activity',
111 'entity' => 'CaseActivity',
112 'bao' => 'CRM_Case_DAO_CaseActivity',
122 'type' => CRM_Utils_Type
::T_INT
,
123 'title' => ts('Case ID'),
124 'description' => ts('Case ID of case-activity association.'),
126 'where' => 'civicrm_case_activity.case_id',
127 'table_name' => 'civicrm_case_activity',
128 'entity' => 'CaseActivity',
129 'bao' => 'CRM_Case_DAO_CaseActivity',
131 'FKClassName' => 'CRM_Case_DAO_Case',
133 'label' => ts("Case"),
138 'name' => 'activity_id',
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Activity ID'),
141 'description' => ts('Activity ID of case-activity association.'),
143 'where' => 'civicrm_case_activity.activity_id',
144 'table_name' => 'civicrm_case_activity',
145 'entity' => 'CaseActivity',
146 'bao' => 'CRM_Case_DAO_CaseActivity',
148 'FKClassName' => 'CRM_Activity_DAO_Activity',
150 'label' => ts("Activity"),
155 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
157 return Civi
::$statics[__CLASS__
]['fields'];
161 * Return a mapping from field-name to the corresponding key (as used in fields()).
164 * Array(string $name => string $uniqueName).
166 public static function &fieldKeys() {
167 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
168 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
170 return Civi
::$statics[__CLASS__
]['fieldKeys'];
174 * Returns the names of this table
178 public static function getTableName() {
179 return self
::$_tableName;
183 * Returns if this table needs to be logged
187 public function getLog() {
192 * Returns the list of fields that can be imported
194 * @param bool $prefix
198 public static function &import($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_activity', $prefix, []);
204 * Returns the list of fields that can be exported
206 * @param bool $prefix
210 public static function &export($prefix = FALSE) {
211 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_activity', $prefix, []);
216 * Returns the list of indices
218 * @param bool $localize
222 public static function indices($localize = TRUE) {
224 'UI_case_activity_id' => [
225 'name' => 'UI_case_activity_id',
230 'localizable' => FALSE,
231 'sig' => 'civicrm_case_activity::0::case_id::activity_id',
234 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;