Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Case/CaseActivity.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
449c4e6b | 9 | * (GenCodeChecksum:51e6c7e07af84da07b90145b2dd8c0df) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the CaseActivity entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Case_DAO_CaseActivity extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
fa45b5b9 | 22 | public static $_tableName = 'civicrm_case_activity'; |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
fa45b5b9 | 29 | public static $_log = TRUE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Unique case-activity association id | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
35 | */ |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Case ID of case-activity association. | |
40 | * | |
e6ca0a57 | 41 | * @var int |
e501603b TO |
42 | */ |
43 | public $case_id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * Activity ID of case-activity association. | |
47 | * | |
e6ca0a57 | 48 | * @var int |
e501603b TO |
49 | */ |
50 | public $activity_id; | |
c3fc2621 | 51 | |
e501603b | 52 | /** |
f41f0342 | 53 | * Class constructor. |
e501603b | 54 | */ |
c3fc2621 | 55 | public function __construct() { |
e501603b TO |
56 | $this->__table = 'civicrm_case_activity'; |
57 | parent::__construct(); | |
58 | } | |
c3fc2621 | 59 | |
449c4e6b CW |
60 | /** |
61 | * Returns localized title of this entity. | |
62 | */ | |
63 | public static function getEntityTitle() { | |
64 | return ts('Case Activities'); | |
65 | } | |
66 | ||
e501603b | 67 | /** |
f41f0342 | 68 | * Returns foreign keys and entity references. |
e501603b TO |
69 | * |
70 | * @return array | |
71 | * [CRM_Core_Reference_Interface] | |
72 | */ | |
c3fc2621 | 73 | public static function getReferenceColumns() { |
346aaaba | 74 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 75 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
76 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'case_id', 'civicrm_case', 'id'); |
77 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'activity_id', 'civicrm_activity', 'id'); | |
346aaaba | 78 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 79 | } |
346aaaba | 80 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 81 | } |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * Returns all the column names of this table | |
85 | * | |
86 | * @return array | |
87 | */ | |
c3fc2621 | 88 | public static function &fields() { |
346aaaba | 89 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
90 | Civi::$statics[__CLASS__]['fields'] = [ |
91 | 'id' => [ | |
e501603b TO |
92 | 'name' => 'id', |
93 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 94 | 'title' => ts('Case Activity ID'), |
215b423e | 95 | 'description' => ts('Unique case-activity association id'), |
c3fc2621 | 96 | 'required' => TRUE, |
a36434b9 | 97 | 'where' => 'civicrm_case_activity.id', |
522a26c9 | 98 | 'table_name' => 'civicrm_case_activity', |
99 | 'entity' => 'CaseActivity', | |
100 | 'bao' => 'CRM_Case_DAO_CaseActivity', | |
6a7e5e5d | 101 | 'localizable' => 0, |
c3fc2621 CW |
102 | ], |
103 | 'case_id' => [ | |
e501603b TO |
104 | 'name' => 'case_id', |
105 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 106 | 'title' => ts('Case'), |
215b423e | 107 | 'description' => ts('Case ID of case-activity association.'), |
c3fc2621 | 108 | 'required' => TRUE, |
a36434b9 | 109 | 'where' => 'civicrm_case_activity.case_id', |
522a26c9 | 110 | 'table_name' => 'civicrm_case_activity', |
111 | 'entity' => 'CaseActivity', | |
112 | 'bao' => 'CRM_Case_DAO_CaseActivity', | |
6a7e5e5d | 113 | 'localizable' => 0, |
e501603b | 114 | 'FKClassName' => 'CRM_Case_DAO_Case', |
c3fc2621 CW |
115 | ], |
116 | 'activity_id' => [ | |
e501603b TO |
117 | 'name' => 'activity_id', |
118 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 119 | 'title' => ts('Activity ID'), |
215b423e | 120 | 'description' => ts('Activity ID of case-activity association.'), |
c3fc2621 | 121 | 'required' => TRUE, |
a36434b9 | 122 | 'where' => 'civicrm_case_activity.activity_id', |
522a26c9 | 123 | 'table_name' => 'civicrm_case_activity', |
124 | 'entity' => 'CaseActivity', | |
125 | 'bao' => 'CRM_Case_DAO_CaseActivity', | |
6a7e5e5d | 126 | 'localizable' => 0, |
e501603b | 127 | 'FKClassName' => 'CRM_Activity_DAO_Activity', |
c3fc2621 CW |
128 | ], |
129 | ]; | |
346aaaba | 130 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 131 | } |
346aaaba | 132 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 133 | } |
c3fc2621 | 134 | |
e501603b | 135 | /** |
bd8e0b14 | 136 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
137 | * |
138 | * @return array | |
bd8e0b14 | 139 | * Array(string $name => string $uniqueName). |
e501603b | 140 | */ |
c3fc2621 | 141 | public static function &fieldKeys() { |
bd8e0b14 TO |
142 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
143 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 144 | } |
bd8e0b14 | 145 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 146 | } |
c3fc2621 | 147 | |
e501603b TO |
148 | /** |
149 | * Returns the names of this table | |
150 | * | |
151 | * @return string | |
152 | */ | |
c3fc2621 | 153 | public static function getTableName() { |
e501603b TO |
154 | return self::$_tableName; |
155 | } | |
c3fc2621 | 156 | |
e501603b TO |
157 | /** |
158 | * Returns if this table needs to be logged | |
159 | * | |
c3fc2621 | 160 | * @return bool |
e501603b | 161 | */ |
c3fc2621 | 162 | public function getLog() { |
e501603b TO |
163 | return self::$_log; |
164 | } | |
c3fc2621 | 165 | |
e501603b TO |
166 | /** |
167 | * Returns the list of fields that can be imported | |
168 | * | |
169 | * @param bool $prefix | |
170 | * | |
171 | * @return array | |
172 | */ | |
c3fc2621 CW |
173 | public static function &import($prefix = FALSE) { |
174 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'case_activity', $prefix, []); | |
60808919 | 175 | return $r; |
e501603b | 176 | } |
c3fc2621 | 177 | |
e501603b TO |
178 | /** |
179 | * Returns the list of fields that can be exported | |
180 | * | |
181 | * @param bool $prefix | |
182 | * | |
183 | * @return array | |
184 | */ | |
c3fc2621 CW |
185 | public static function &export($prefix = FALSE) { |
186 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'case_activity', $prefix, []); | |
60808919 | 187 | return $r; |
e501603b | 188 | } |
c3fc2621 | 189 | |
e7a6b91a AS |
190 | /** |
191 | * Returns the list of indices | |
c3fc2621 CW |
192 | * |
193 | * @param bool $localize | |
194 | * | |
195 | * @return array | |
e7a6b91a AS |
196 | */ |
197 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
198 | $indices = [ |
199 | 'UI_case_activity_id' => [ | |
e7a6b91a | 200 | 'name' => 'UI_case_activity_id', |
c3fc2621 | 201 | 'field' => [ |
e7a6b91a AS |
202 | 0 => 'case_id', |
203 | 1 => 'activity_id', | |
c3fc2621 CW |
204 | ], |
205 | 'localizable' => FALSE, | |
e7a6b91a | 206 | 'sig' => 'civicrm_case_activity::0::case_id::activity_id', |
c3fc2621 CW |
207 | ], |
208 | ]; | |
e7a6b91a AS |
209 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
210 | } | |
c3fc2621 | 211 | |
e501603b | 212 | } |