Closed struan closed 8 years ago
At the moment this is manual so for of_class you have to specify both the Entity class and the Collection class because it's not clear how to link the two. I'm not sure it's possible to specify a collection_class property for an Entity because of ordering - e.g. the Elections class is defined after Election so can't be used in Election.
After discussing in Slack this was updated to be of_collection
to avoid the need to pass two classes.
of_class
was returning arrays so update it to return collections, at the same time updatingnew_collection
to accept an option collection class to instantiate. This means that if you are fetching a collection of sub-classes then you can instantiate the correct collection.At the moment this is manual so for
of_class
you have to specify both the Entity class and the Collection class because it's not clear how to link the two. I'm not sure it's possible to specify acollection_class
property for anEntity
because of ordering - e.g. theElections
class is defined afterElection
so can't be used inElection
.Fixes #116