-
MODX Staff
- 10,725 Posts
Hello Jon
MODx Revolution uses single-table inheritance (see the modResource base class and it’s derivatives, modDocument, modStaticResource, modWebLink, and modSymLink), and there is also a sample model (and some unit tests) for single-table inheritance in the xpdo repository’s test/ directory. It all revolves around using the extends attribute in your object element in the schema and having a class_key field in your table.
You can also look at modElement and it’s derivatives (modScript, modChunk, modTemplateVar, etc.) for a way to accomplish multi-table inheritance, though it does not support cross-table searches or other features so those have to be implemented above and beyond the generated code from the schema.
If you need further direction, just ask...
Thanks Jason
That’s great, I shall feedback my progress as soon as I get some time to work on this, and undoubtedly post some more questions!
Many thanks
Jon