Skip to content
Snippets Groups Projects
Commit 0991ba8e authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

orm: Add support for overlay annotations

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.
parent 993dbe61
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment