Merge pull request #20431 from colemanw/garlandTabFix
[civicrm-core.git] / Civi / Api4 / RelationshipCache.php
CommitLineData
bf01b886
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
20namespace Civi\Api4;
21
22/**
23 * RelationshipCache - readonly table to facilitate joining and finding contacts by relationship.
24 *
25 * @see \Civi\Api4\Relationship
2f616560 26 * @ui_join_filters near_relation
bf01b886
CW
27 * @package Civi\Api4
28 */
29class RelationshipCache extends Generic\AbstractEntity {
465bc32a 30 use Generic\Traits\EntityBridge;
bf01b886
CW
31
32 /**
33 * @param bool $checkPermissions
34 * @return Generic\DAOGetAction
35 */
36 public static function get($checkPermissions = TRUE) {
9f338c09 37 return (new Generic\DAOGetAction(__CLASS__, __FUNCTION__))
bf01b886
CW
38 ->setCheckPermissions($checkPermissions);
39 }
40
41 /**
42 * @param bool $checkPermissions
43 * @return Generic\DAOGetFieldsAction
44 */
45 public static function getFields($checkPermissions = TRUE) {
9f338c09 46 return (new Generic\DAOGetFieldsAction(__CLASS__, __FUNCTION__))
bf01b886
CW
47 ->setCheckPermissions($checkPermissions);
48 }
49
27d31a0f
CW
50 /**
51 * @return array
52 */
53 public static function getInfo() {
54 $info = parent::getInfo();
55 $info['bridge'] = [
56 'near_contact_id' => ['description' => ts('One or more contacts with a relationship to this contact')],
57 'far_contact_id' => ['description' => ts('One or more contacts with a relationship to this contact')],
58 ];
59 return $info;
60 }
61
bf01b886 62}