SUBCLASSING

It is possible to declare a subclass of an existing MT::Object class, one that shares the same table storage as the parent class. Examples of this include MT::Log, MT::Entry, MT::Category. In these cases, the subclass identifies a 'class_type' property. The parent class must also have a column where this identifier is stored. Upon loading records from the table, the object is reblessed into the appropriate package.

Class->addclass( $typeid, $class )

This method can be called directly to register a new subclass type and package for the base class.

MT::Foo->add_class( 'foochild' => 'MT::Foo::Subclass' );
This page was last updated on 2008-10-01, 17:07.  

Leave a note

Have a question, please use the MT Forums. Notes sumbitted here should pertain to tips & hints regarding documentation. Your note may be removed once it's contents has be integrated into the body of the page.