3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
14 * RelationshipCache - readonly table to facilitate joining and finding contacts by relationship.
16 * @searchable secondary
17 * @see \Civi\Api4\Relationship
18 * @ui_join_filters near_relation
22 class RelationshipCache
extends Generic\AbstractEntity
{
23 use Generic\Traits\EntityBridge
;
26 * @param bool $checkPermissions
27 * @return Generic\DAOGetAction
29 public static function get($checkPermissions = TRUE) {
30 return (new Generic\
DAOGetAction(__CLASS__
, __FUNCTION__
))
31 ->setCheckPermissions($checkPermissions);
35 * @param bool $checkPermissions
36 * @return Generic\DAOGetFieldsAction
38 public static function getFields($checkPermissions = TRUE) {
39 return (new Generic\
DAOGetFieldsAction(__CLASS__
, __FUNCTION__
))
40 ->setCheckPermissions($checkPermissions);
46 public static function getInfo() {
47 $info = parent
::getInfo();
48 $info['bridge_title'] = ts('Relationship');
50 'near_contact_id' => [
51 'to' => 'far_contact_id',
52 'label' => ts('Related Contacts'),
53 'description' => ts('One or more related contacts'),
56 if (in_array('CiviCase', \Civi
::settings()->get('enable_components'), TRUE)) {
57 $info['bridge']['case_id'] = [
58 'to' => 'far_contact_id',
59 'label' => ts('Case Roles'),
60 'description' => ts('Cases in which this contact has a role'),