Merge remote-tracking branch 'upstream/4.5' into 4.5-4.6-2015-03-23-18-42-19
[civicrm-core.git] / CRM / Core / Reference / Interface.php
index f949994c3b11b82d9bbf0233f895b343f8c79962..09e0a0ba6dbf5eec1ab98082dc6cc1046c5906f5 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+
+/**
+ * Interface CRM_Core_Reference_Interface
+ */
 interface CRM_Core_Reference_Interface {
   public function getReferenceTable();
 
@@ -13,10 +17,24 @@ interface CRM_Core_Reference_Interface {
   public function matchesTargetTable($tableName);
 
   /**
-   * Create a query to find references to a particular record
+   * Create a query to find references to a particular record.
    *
-   * @param CRM_Core_DAO $targetDao the instance for which we want references
+   * @param CRM_Core_DAO $targetDao
+   *   The instance for which we want references.
    * @return CRM_Core_DAO|NULL a query-handle (like the result of CRM_Core_DAO::executeQuery)
    */
   public function findReferences($targetDao);
+
+  /**
+   * Create a query to find references to a particular record.
+   *
+   * @param CRM_Core_DAO $targetDao
+   *   The instance for which we want references.
+   * @return array
+   *   a record describing the reference; must include the keys:
+   *   - 'type': string (not necessarily unique)
+   *   - 'count': int
+   */
+  public function getReferenceCount($targetDao);
+
 }