Skip to content
  • Jared Hancock's avatar
    0991ba8e
    orm: Add support for overlay annotations · 0991ba8e
    Jared Hancock authored
    This is a new concept for many-to-many relationships, where the extra fields
    from the middle table can be overlaid over the related model using the
    AnnotatedModel paradigm. The overlaid fields are writable and updates are
    saved to the middle model.
    
    This is performed using a new ::wrap method of the AnnotatedModel class.
    
    AnnotatedModel::wrap($what, $overlay, [$class])
    
    Which will create a new class which is a subclass of `$what`, and will have
    the extra properties in `$overlay` accessible as normal properties.
    `$overlay` can be an array or a VerySimpleModel instance. The latter is
    required for writable overlays.
    0991ba8e
    orm: Add support for overlay annotations
    Jared Hancock authored
    This is a new concept for many-to-many relationships, where the extra fields
    from the middle table can be overlaid over the related model using the
    AnnotatedModel paradigm. The overlaid fields are writable and updates are
    saved to the middle model.
    
    This is performed using a new ::wrap method of the AnnotatedModel class.
    
    AnnotatedModel::wrap($what, $overlay, [$class])
    
    Which will create a new class which is a subclass of `$what`, and will have
    the extra properties in `$overlay` accessible as normal properties.
    `$overlay` can be an array or a VerySimpleModel instance. The latter is
    required for writable overlays.
Loading