Merge pull request #21250 from agileware/CIVICRM-1820
[civicrm-core.git] / Civi / Api4 / RelationshipCache.php
index 2f5ad02cc38313b78e4ae40a6cc31bee9e2c03be..e967d2373fbb604534cab0546fe064a09c995b8f 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC. All rights reserved.                        |
@@ -9,22 +8,15 @@
  | and copyright information, see https://civicrm.org/licensing       |
  +--------------------------------------------------------------------+
  */
-
-/**
- *
- * @package CRM
- * @copyright CiviCRM LLC https://civicrm.org/licensing
- */
-
-
 namespace Civi\Api4;
 
 /**
  * RelationshipCache - readonly table to facilitate joining and finding contacts by relationship.
  *
+ * @searchable secondary
  * @see \Civi\Api4\Relationship
- * @bridge near_contact_id far_contact_id
  * @ui_join_filters near_relation
+ * @since 5.29
  * @package Civi\Api4
  */
 class RelationshipCache extends Generic\AbstractEntity {
@@ -48,4 +40,17 @@ class RelationshipCache extends Generic\AbstractEntity {
       ->setCheckPermissions($checkPermissions);
   }
 
+  /**
+   * @return array
+   */
+  public static function getInfo() {
+    $info = parent::getInfo();
+    $info['bridge_title'] = ts('Relationship');
+    $info['bridge'] = [
+      'near_contact_id' => ['description' => ts('One or more contacts with a relationship to this contact')],
+      'far_contact_id' => ['description' => ts('One or more contacts with a relationship to this contact')],
+    ];
+    return $info;
+  }
+
 }