Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-08-19-00-06-22
[civicrm-core.git] / CRM / Core / Reference / Interface.php
1 <?php
2
3 /**
4 * Interface CRM_Core_Reference_Interface
5 */
6 interface 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
23 * @return CRM_Core_DAO|NULL a query-handle (like the result of CRM_Core_DAO::executeQuery)
24 */
25 public function findReferences($targetDao);
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);
36 }