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