Relation is an API module and storage model for both simple and the most complex relations between entities. The module can handle both directional and symmetrical relations very well.
Relations are entities and can therefore have fields. This makes Relation the most flexible and powerful relation model out there. (Still, using Relation with anything but the default SQL storage will not work in most cases.)
John, Jen and Jack are siblings. This relation are symmetrical and points in all directions.
|-- John | Are siblings --|-- Jen (relation) | |-- Jack
CompanyA a made a donation to PartyB, with a transaction via BankC. Both relations (donation and transaction) are directional.
CompanyA --> DonationX --> PartyB (node) (relation) (node) DonationX --> TransactionY --> BankC (relation) (relation) (node)
In the example above DonationX can have an integer field for the donation amount. This is something that no other relationship models in Drupal supports.
Drupal 8 version
The work on Drupal 8 version has started. The development progress can be followed on issue.
While a similar module could be built based on Entityreference and Entity Construction Kit (ECK) by creating a custom entity and adding entity reference fields to it, this hypothetical module would not be able to
- refer different kinds of entities for one endpoint
- handle symmetrical relations in one API (for eg. a single rule can be fired for both ends of the relationship)
- list siblings with Views
- support revisions
Also, relation, while very capable, is a small module which works with many contrib modules but requires none. We keep the API module as small as possible, adding new features into submodules as much as possible.
- Maintenance status: Actively maintained
- Development status: Under active development
- Module categories: Developer, Fields
- Reported installs: 9,830 sites currently report using this module. View usage statistics.
- Downloads: 230,144
- Automated tests: Enabled
- Last modified: December 15, 2016
- Stable releases are covered by the security advisory policy.
Look for the shield icon below.