Merge pull request #24027 from totten/master552-status-footer-skipsort
[civicrm-core.git] / CRM / Core / Reference / Interface.php
... / ...
CommitLineData
1<?php
2
3/**
4 * Interface CRM_Core_Reference_Interface
5 */
6interface CRM_Core_Reference_Interface {
7
8 public function getReferenceTable();
9
10 public function getReferenceKey();
11
12 /**
13 * Determine if a given table is a target of this reference.
14 *
15 * @param string $tableName
16 * @return bool
17 */
18 public function matchesTargetTable($tableName);
19
20 /**
21 * Create a query to find references to a particular record.
22 *
23 * @param CRM_Core_DAO $targetDao
24 * The instance for which we want references.
25 * @return CRM_Core_DAO|NULL a query-handle (like the result of CRM_Core_DAO::executeQuery)
26 */
27 public function findReferences($targetDao);
28
29 /**
30 * Create a query to find references to a particular record.
31 *
32 * @param CRM_Core_DAO $targetDao
33 * The instance for which we want references.
34 * @return array{type: string, count: int}|NULL
35 * a record describing the reference; must include the keys:
36 * - 'type': string (not necessarily unique)
37 * - 'count': int
38 */
39 public function getReferenceCount($targetDao);
40
41}