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