In enterprise software like Vantive and Peoplesoft, there were always common entities like Address and Notes which could be applied to many parent objects while being a common object. In some places this was called "Multi-Parent Child". Here is an example database schema:
CREATE TABLE tbl_notes (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
parentId INTEGER NOT NULL,
parentType VARCHAR(20),
subject VARCHAR(100),
description TEXT
)
CREATE TABLE tbl_company (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
...
)
CREATE TABLE tbl_person (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
...
)
With some data in tbl_notes like this:
INSERT INTO `tbl_notes` (`id`,`parentId`,`parentType`,`subject`,`description`)
VALUES
(1, 1, 'company', 'ready to buy', 'Lets be aggressive with pricing'),
(2, 1, 'person', 'important contact', 'He is not busy at lunch, call 15m before noon when scheduling'),
(3, 2, 'company', 'fishing', 'I suspect this company is not really interested in our product');
It’s not clear to me that this is easy to model using Yii’s Relational ActiveRecord model. I am a bit inflexible on a paradigm shift because this data is already encoded, if I were to change the data structure, we would not be able to phase in new modules in Yii, but would need to rollout with a big cut over (not happening) or sync data (costly, error-prone) between the current framework and Yii.