DAO function to list all foreign key references to a table
authorAdam Roses Wight <awight@wikimedia.org>
Wed, 24 Apr 2013 23:16:40 +0000 (16:16 -0700)
committerAdam Roses Wight <awight@wikimedia.org>
Thu, 25 Apr 2013 19:05:57 +0000 (12:05 -0700)
commit71e5aa5ca52fb158fb91e0636d11b79593ef0929
treec4a344aba6d1176e73bb742626d0892a89d4b78e
parent6b5ff8c9744e8ea919aa46c60179f61dfb6fc115
DAO function to list all foreign key references to a table

This patch also begins to formally describe the entity_id/entity_table
references, introducing a new first-class object CRM_Core_EntityReference.
We still need some way to describe the restrictions on the possible values of
entity_table for each DAO, so that findReferences() doesn't have to scan
all tables using a generic pointer.

Note that I've broken compatibility with PEAR links(), this would be
easy to reimplement if we need, but it was not being unused in core.
33 files changed:
CRM/Core/DAO.php
CRM/Core/EntityReference.php [new file with mode: 0644]
CRM/Financial/BAO/FinancialType.php
api/api.php
tests/phpunit/CRM/Core/DAOTest.php [new file with mode: 0644]
xml/GenCode.php
xml/schema/ACL/ACL.xml
xml/schema/ACL/EntityRole.xml
xml/schema/Activity/ActivityAssignment.xml
xml/schema/Batch/EntityBatch.xml
xml/schema/Campaign/CampaignGroup.xml
xml/schema/Case/CaseActivity.xml
xml/schema/Contribute/Premium.xml
xml/schema/Core/ActionLog.xml
xml/schema/Core/Discount.xml
xml/schema/Core/EntityFile.xml
xml/schema/Core/EntityTag.xml
xml/schema/Core/Log.xml
xml/schema/Core/Note.xml
xml/schema/Core/UFJoin.xml
xml/schema/Financial/EntityFinancialAccount.xml
xml/schema/Financial/EntityFinancialTrxn.xml
xml/schema/Financial/FinancialItem.xml
xml/schema/Friend/Friend.xml
xml/schema/Mailing/Group.xml
xml/schema/PCP/PCPBlock.xml
xml/schema/Pledge/PledgeBlock.xml
xml/schema/Price/LineItem.xml
xml/schema/Price/SetEntity.xml
xml/schema/Project/Project.xml
xml/schema/Project/Task.xml
xml/schema/Project/TaskStatus.xml
xml/templates/dao.tpl