Merge pull request #24081 from seamuslee001/php81_trait
[civicrm-core.git] / Civi / Api4 / CaseContact.php
1 <?php
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 */
11 namespace Civi\Api4;
12
13 /**
14 * CaseContact BridgeEntity.
15 *
16 * This connects a client to a case.
17 *
18 * @searchable bridge
19 * @see \Civi\Api4\Case
20 * @since 5.37
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
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
50 }