Commit | Line | Data |
---|---|---|
11626cf1 | 1 | <?php |
b5c2afd0 EM |
2 | |
3 | /** | |
4 | * Interface CRM_Core_Reference_Interface | |
5 | */ | |
11626cf1 | 6 | interface CRM_Core_Reference_Interface { |
518fa0ee | 7 | |
11626cf1 TO |
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 | /** | |
d09edf64 | 21 | * Create a query to find references to a particular record. |
11626cf1 | 22 | * |
6a0b768e TO |
23 | * @param CRM_Core_DAO $targetDao |
24 | * The instance for which we want references. | |
ffcef054 | 25 | * @return CRM_Core_DAO|NULL a query-handle (like the result of CRM_Core_DAO::executeQuery) |
11626cf1 TO |
26 | */ |
27 | public function findReferences($targetDao); | |
1256c139 TO |
28 | |
29 | /** | |
d09edf64 | 30 | * Create a query to find references to a particular record. |
1256c139 | 31 | * |
6a0b768e TO |
32 | * @param CRM_Core_DAO $targetDao |
33 | * The instance for which we want references. | |
a6c01b45 CW |
34 | * @return array |
35 | * a record describing the reference; must include the keys: | |
16b10e64 CW |
36 | * - 'type': string (not necessarily unique) |
37 | * - 'count': int | |
1256c139 TO |
38 | */ |
39 | public function getReferenceCount($targetDao); | |
96025800 | 40 | |
11626cf1 | 41 | } |