Custom Models with Relations

Hi there. That’s my first post here so I say hello to everybody :)

I have a question. In my application some data are stored on database and I have no problem with them. But other data is stored in completely different place so I would like to write custom Models for each type of data. The problem is that I would like to have a possibility to make a relation just like in automagically created DB model classes in Yii. I suppose I should create classes that have simmilar interface that CActiveRecord but I’m not sure. :unsure:

what are the other storage locations? other databases? or flat-text? or something else entirely?

Thanks for quick reply intel352 (cool avatar btw)

It’s something else entirely. I will provide mechanism for some crud operations (at least read) but I don’t know what interface to use. Data have id, and other stuff so for other classes it could look just like CActiveRecords.

I’m not sure it’s even possible to do this.

thx about the avatar :slight_smile: need a higher quality version of it tho, it’s getting blown out on the forum, heh.

i agree that building a model similar to CActiveRecord would be good. really you could probably extend AR, so that any joins check to ensure the accompanying model is AR vs your other data source type. if it’s the other type, then override how it “joins”.

sounds like alot of double-work tho