Class Activerecord_node
This is a domain class that governs all tables around a node such that they can be loaded, changed and saved via a single model. It assumes that there is a node record with the indicated ID, and that it has a node_version record and a third table joined by VID. It is therefore an adapter for three seperate tables: the node table, the node_revisions table, and whatever table is indicated by the type. It also assumes that the table name is equal to the node type; if this is not true some custom coding or type/table name mappping may be required.
It etends Activerecord and doesn't have any additional methods; however its core methods are slightly different.
save() calls node_save() to save the basic node record. However after calling this method, the fields are trimmed back to the node. it also refreshes the node_revisions Activerecord.
Its magic fields look for fields in the node table, then the node_revisions table, then your custom field. If you want to address fields in one table that also exist in the other tables, you will need to address them manually.

Post new comment