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 | * CaseContact BridgeEntity. | |
15 | * | |
16 | * This connects a client to a case. | |
17 | * | |
c5076889 | 18 | * @searchable bridge |
a62d97f3 | 19 | * @see \Civi\Api4\Case |
d44cc3cb | 20 | * @since 5.37 |
a62d97f3 CW |
21 | * @package Civi\Api4 |
22 | */ | |
23 | class CaseContact extends Generic\DAOEntity { | |
24 | use Generic\Traits\EntityBridge; | |
25 | ||
26 | protected static function getEntityTitle($plural = FALSE) { | |
27 | return $plural ? ts('Case Clients') : ts('Case Client'); | |
28 | } | |
29 | ||
63f3df59 CW |
30 | /** |
31 | * @return array | |
32 | */ | |
33 | public static function getInfo() { | |
34 | $info = parent::getInfo(); | |
35 | $info['bridge_title'] = ts('Clients'); | |
36 | $info['bridge'] = [ | |
37 | 'case_id' => [ | |
38 | 'to' => 'contact_id', | |
39 | 'description' => ts('Cases with this contact as a client'), | |
40 | ], | |
41 | 'contact_id' => [ | |
42 | 'label' => ts('Clients'), | |
43 | 'to' => 'case_id', | |
44 | 'description' => ts('Clients for this case'), | |
45 | ], | |
46 | ]; | |
47 | return $info; | |
48 | } | |
49 | ||
a62d97f3 | 50 | } |