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:e5c1c45fc5dc666a02a3c1e872ba9a2b)
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
42 * Case ID of case-activity association.
49 * Activity ID of case-activity association.
58 public function __construct() {
59 $this->__table
= 'civicrm_case_activity';
60 parent
::__construct();
64 * Returns localized title of this entity.
67 * Whether to return the plural version of the title.
69 public static function getEntityTitle($plural = FALSE) {
70 return $plural ?
ts('Case Activities') : ts('Case Activity');
74 * Returns foreign keys and entity references.
77 * [CRM_Core_Reference_Interface]
79 public static function getReferenceColumns() {
80 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
81 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
82 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'case_id', 'civicrm_case', 'id');
83 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'activity_id', 'civicrm_activity', 'id');
84 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
86 return Civi
::$statics[__CLASS__
]['links'];
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('Case Activity ID'),
101 'description' => ts('Unique case-activity association id'),
103 'where' => 'civicrm_case_activity.id',
104 'table_name' => 'civicrm_case_activity',
105 'entity' => 'CaseActivity',
106 'bao' => 'CRM_Case_DAO_CaseActivity',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Case ID'),
118 'description' => ts('Case ID of case-activity association.'),
120 'where' => 'civicrm_case_activity.case_id',
121 'table_name' => 'civicrm_case_activity',
122 'entity' => 'CaseActivity',
123 'bao' => 'CRM_Case_DAO_CaseActivity',
125 'FKClassName' => 'CRM_Case_DAO_Case',
127 'label' => ts("Case"),
132 'name' => 'activity_id',
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Activity ID'),
135 'description' => ts('Activity ID of case-activity association.'),
137 'where' => 'civicrm_case_activity.activity_id',
138 'table_name' => 'civicrm_case_activity',
139 'entity' => 'CaseActivity',
140 'bao' => 'CRM_Case_DAO_CaseActivity',
142 'FKClassName' => 'CRM_Activity_DAO_Activity',
144 'label' => ts("Activity"),
149 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
151 return Civi
::$statics[__CLASS__
]['fields'];
155 * Return a mapping from field-name to the corresponding key (as used in fields()).
158 * Array(string $name => string $uniqueName).
160 public static function &fieldKeys() {
161 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
162 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
164 return Civi
::$statics[__CLASS__
]['fieldKeys'];
168 * Returns the names of this table
172 public static function getTableName() {
173 return self
::$_tableName;
177 * Returns if this table needs to be logged
181 public function getLog() {
186 * Returns the list of fields that can be imported
188 * @param bool $prefix
192 public static function &import($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_activity', $prefix, []);
198 * Returns the list of fields that can be exported
200 * @param bool $prefix
204 public static function &export($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_activity', $prefix, []);
210 * Returns the list of indices
212 * @param bool $localize
216 public static function indices($localize = TRUE) {
218 'UI_case_activity_id' => [
219 'name' => 'UI_case_activity_id',
224 'localizable' => FALSE,
225 'sig' => 'civicrm_case_activity::0::case_id::activity_id',
228 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;