The general idea is to provide MidCOM with a way to hook into every database interaction
between the component and the Midgard core.
Since PHP does not allow for multiple inheritance (which would be really useful here),
a decorator pattern is used, which connects the class you actually use in your component
and the original MgdSchema class while at the same time routing all function calls through
The class loader does not require much information when registering classes:
An example declaration looks like this:
The key is the MgdSchema class name from that you want to use. The class specified must exist.
The value is the name of the MidCOM base class you intend to create.
It is checked for basic validity against the PHP restrictions on symbol naming, but the
class itself is not checked for existence. You must declare the class as listed at
all times, as typecasting and detection is done using this metadata property in the core.
Inherited class requirements
The classes you inherit from the intermediate stub classes must at this time satisfy one
requirement: You have to declare the midcom and mgdschema classnames:
public $midcom_class_name = CLASS;
public $mgdschema_class_name = 'midgard_article';