civicrm/civicrm-core — pull request #3322 by totten (2014-05-21 09:07:05+00:00)
Title: CRM-14478 - Add generic API, "getrefcount"

For example: Before deciding whether to delete a RelationshipType, we can
call "RelationshipType.getrefcount" to see how many usages there are.

TODO: This counts references stored in standard SQL FK's, in dynamic SQL
FK's, and in option-value FK's. It does not yet count references stored in
CiviCase XML.