Commit | Line | Data |
---|---|---|
a62d97f3 | 1 | <?php |
a62d97f3 CW |
2 | /* |
3 | +--------------------------------------------------------------------+ | |
4 | | Copyright CiviCRM LLC. All rights reserved. | | |
5 | | | | |
6 | | This work is published under the GNU AGPLv3 license with some | | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
9 | +--------------------------------------------------------------------+ | |
10 | */ | |
a62d97f3 CW |
11 | namespace Civi\Api4; |
12 | ||
13 | /** | |
14 | * Case entity. | |
15 | * | |
16 | * Note that the class for this entity is named "CiviCase" because "Case" is a keyword reserved by php. | |
17 | * | |
18 | * @see https://docs.civicrm.org/user/en/latest/case-management/what-is-civicase/ | |
aa998597 | 19 | * @searchable primary |
d44cc3cb | 20 | * @since 5.37 |
a62d97f3 CW |
21 | * @package Civi\Api4 |
22 | */ | |
23 | class CiviCase extends Generic\DAOEntity { | |
24 | ||
25 | /** | |
26 | * Explicitly declare entity name because it doesn't match the name of this class | |
27 | * (due to the php reserved keyword issue) | |
28 | * | |
29 | * @return string | |
30 | */ | |
31 | protected static function getEntityName() { | |
32 | return 'Case'; | |
33 | } | |
34 | ||
35 | /** | |
36 | * @param bool $checkPermissions | |
37 | * @return Action\CiviCase\Create | |
38 | */ | |
39 | public static function create($checkPermissions = TRUE) { | |
40 | return (new Action\CiviCase\Create('Case', __FUNCTION__)) | |
41 | ->setCheckPermissions($checkPermissions); | |
42 | } | |
43 | ||
44 | /** | |
45 | * @param bool $checkPermissions | |
46 | * @return Action\CiviCase\Save | |
47 | */ | |
48 | public static function save($checkPermissions = TRUE) { | |
49 | return (new Action\CiviCase\Save('Case', __FUNCTION__)) | |
50 | ->setCheckPermissions($checkPermissions); | |
51 | } | |
52 | ||
53 | /** | |
54 | * @param bool $checkPermissions | |
55 | * @return Action\CiviCase\Update | |
56 | */ | |
57 | public static function update($checkPermissions = TRUE) { | |
58 | return (new Action\CiviCase\Update('Case', __FUNCTION__)) | |
59 | ->setCheckPermissions($checkPermissions); | |
60 | } | |
61 | ||
62 | } |