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